I quickly put this code together to test if it would disable some of my functions OnChange when my text box (purchase order number) is empty...and if it would enable those functions when I added data to my field. The funny thing is that if you read the code it actually runs in reverse! When my field is null it is suppose to disable...inste ad it enables...Why? So I put my code in to do the opposite of what I want and it works!?!?! I don't mind having my code in logical reverse as long as I get the results I'm looking for...but...I don't get it....???? ;-)
Forwards: (works in reverse and enables features when Null)
Backwards: (disables features when null)
Forwards: (works in reverse and enables features when Null)
Code:
Private Sub PurchaseOrderNumber_Change() If IsNull(Me.PurchaseOrderNumber) Then Me.Check107.Enabled = False Me.Check111.Enabled = False Me.Text77.Enabled = False Me.Label119.Visible = True Else Me.Check107.Enabled = True Me.Check111.Enabled = True Me.Text77.Enabled = True Me.Label119.Visible = False End If End Sub
Code:
Private Sub PurchaseOrderNumber_Change() If IsNull(Me.PurchaseOrderNumber) Then Me.Check107.Enabled = True Me.Check111.Enabled = True Me.Text77.Enabled = True Me.Label119.Visible = False Else Me.Check107.Enabled = False Me.Check111.Enabled = False Me.Text77.Enabled = False Me.Label119.Visible = True End If End Sub
Comment