PDA

View Full Version : Object Required



ElvisFan
07-19-2007, 06:50 AM
Hello, I have an Access question. I am using Access 2002. I am using a very simple form to run a query. I am checking a date field and another field. Everything works fine as long as the fields are filled in. If I leave the date field blank and run the query, I get the message "you cancelled the previous operation." So I am trying to check for a null field. I tried
"if me.txtdate is null then
msgbox("Please fill in a date")
When I have this in Afterupdate for the field. I get the message "object required" I don't understand why the if statement wouldn't work.
Any insight on this?
Thanks,

mattj
07-19-2007, 08:19 AM
If IsNull(Me.txtDate) Then
MsgBox "Please Enter a date", vbOkOnly
End If

HTH
Matt

ElvisFan
07-19-2007, 12:55 PM
Thank you.

mattj
07-23-2007, 08:21 AM
np!