Form textbox after update clicks check box on subfrom

hllary

Registered User.
Local time
Today, 05:07
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
 
Code:
Private Sub VarianceNumber_AfterUpdate()
    If  Nz(Me.VarianceNumber, False) Then
        [Drawing Implementation subform]!Check85 = -1
    End If
    
End Sub
 
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
 
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
 
compile your code see where there other errors.
also check for missing Reference.
 

Users who are viewing this thread

Back
Top Bottom