Delete record - error You entered an expression that has an invalid reference...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcinM
    New Member
    • Nov 2014
    • 15

    Delete record - error You entered an expression that has an invalid reference...

    Hello,

    Once I delete a record on a form (form has a subform) using a button available on a ribbon the following error window is displayed:
    „You entered an expression that has an invalid reference to the property Form/Report“ – the error is display in a window with OK button only.
    It is displayed after either OK or Cancel button is pressed, when delete confirmation dialog box appears.

    I have already gone through a few posts but I haven’t found a clear answer.
    I already assumed that it might have something to do with referencing forms using “Parent” property. I changed “Parent” to “Forms!... .” but without any change.

    The line which triggers errors is:
    Code:
    F.requiredField_label.Visible = False
    This line is in the following procedure


    Code:
    Sub subHideLabelForReguiredField(F As Form)
    'some code here
        If intNumberOfOrderedItems <> 0 Then
    	F.requiredField_label.Visible = False
        Else
           	F.requiredField_label.Visible = True
        End If
    'error handling code here
    End Sub
    Appreciate any hints.

    Access 2007
    Last edited by MarcinM; Jan 8 '15, 09:04 AM. Reason: Found line causing the error
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    Try:
    Code:
    F.Form.requiredField_label.Visible = False

    Comment

    Working...