Form textbox after update clicks check box on subfrom (1 Viewer)

hllary

Registered User.
Local time
Today, 04:57
Joined
Sep 23, 2019
Messages
80
I have textbox on a form and after it has been updated I would like a check box on a subform to be clicked.

I would like to do this in VBA but I can't get it to work. My code is below.

Code:
Private Sub VarianceNumber_AfterUpdate()
    If (Me.VarianceNumber) = Not Null Then
    Forms![Drawing Implementation subform].Check85 = -1
    End If
    
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:57
Joined
May 7, 2009
Messages
19,235
Code:
Private Sub VarianceNumber_AfterUpdate()
    If  Nz(Me.VarianceNumber, False) Then
        [Drawing Implementation subform]!Check85 = -1
    End If
    
End Sub
 

bob fitz

AWF VIP
Local time
Today, 12:57
Joined
May 23, 2011
Messages
4,721
Untested but maybe:
Code:
Private Sub VarianceNumber_AfterUpdate()
    If len(Nz(Me.VarianceNumber,0)) > 0 Then
      Forms![Drawing Implementation subform].Form.Check85 = -1
    Else
      Forms![Drawing Implementation subform].Form.Check85 = 0

    End If
    
End Sub
 

hllary

Registered User.
Local time
Today, 04:57
Joined
Sep 23, 2019
Messages
80
Code:
Private Sub VarianceNumber_AfterUpdate()
    If  Nz(Me.VarianceNumber, False) Then
        [Drawing Implementation subform]!Check85 = -1
    End If
    
End Sub

I'm getting an error at the If Nz line
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 19:57
Joined
May 7, 2009
Messages
19,235
compile your code see where there other errors.
also check for missing Reference.
 

Users who are viewing this thread

Top Bottom