You cannot assign value to this object - Error 2448

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tapich
    New Member
    • Jun 2010
    • 1

    You cannot assign value to this object - Error 2448

    Hello Developers,

    I have this strange runtime exception coming up for an application that has been running fine from 10 years. There is a label(txtlabel) on a report (Report_cell1)i n my Access Db; When the application is trying to assign a value to this label, this error is coming up.

    Here is the code part where the exception is coming:

    Code:
    
    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
        If Me![LabelsPath] Like "*Mercury*" Then
            Me!txtLabel = "LABELS:  " & Me![LabelsPath] & "\" & Format(Date, "mmddyyyy") & Right(Me![LabelsPath], 27)
        Else
            If IsNull([LabelsPath]) = True Then
            Else
                Me!txtLabel = Me![LabelsPath] & "" <<HERE THE APPLICATION IS FAILING>>
            End If
        End If
    End Sub

    Can someone please help? Really appreciate any little help.

    Thanks,

    Tapich
    Attached Files
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    Have you tried to use the label's "Caption" property? For instance,

    Code:
    Me!txtLabel.Caption = "LABELS:  " & Me![LabelsPath] & "\" & Format(Date, "mmddyyyy") & Right(Me![LabelsPath], 27)

    Also, to avoid confusion, if this really is a label and not a text box, use "lbl" or some similar prefix for the control name; so, "lblSomeLabelNa me". Usually "txt" denotes a text box.

    Pat

    Comment

    Working...