Cody Vance
asked on
Object Required Error
Hi Experts,
Can someone tell me why I am getting an Object Required Error on this?? It seems like a simple SUB to me, but apparently I am missing something simple...
Cody-
Can someone tell me why I am getting an Object Required Error on this?? It seems like a simple SUB to me, but apparently I am missing something simple...
Cody-
Private Sub Form_Load()
If Me.txtAddress1.Value Is Null Then
Me.lblAskAddress.Visible = True
Else
Me.lblAskAddress.Visible = False
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried changing Null to Nothing
Change to:
Private Sub Form_Load()
If IsNull(Me.txtAddress1.Value) Then
Me.lblAskAddress.Visible = True
Else
Me.lblAskAddress.Visible = False
End If
End Sub
ASKER
Both worked, thanks!
Nothing only applies to Object variables, which is not the case here.
Try this
Private Sub Form_Load()
If Nz(Me.txtAddress1, "") ="" Then
Me.lblAskAddress.Visible = True
Else
Me.lblAskAddress.Visible = False
End If
End Sub
Try this
Private Sub Form_Load()
If Nz(Me.txtAddress1, "") ="" Then
Me.lblAskAddress.Visible = True
Else
Me.lblAskAddress.Visible = False
End If
End Sub