How Can I use If Statement to check if field is blank?

  • Thread starter Thread starter Curaçaoboy
  • Start date Start date
C

Curaçaoboy

Guest
Hi,
I am using a if statement to detect if a field is blank. And if it is blank a msgbox will show up.

I have tried it with = Null,= Empty, ="" . But none of the works
I know that it is possible,but I don't know how.

Any advice??

If Me![TxtStartDate] = " " Then
MsgBox "You need to enter a begin date"

Else
DoCmd.SetWarnings False
EndIf
 
Thanks!!!!!!!!!!!!!

WORKS!!!!!!!!!!!!!

Thanks!!! Again
 
Code:
If IsNull(MyTextBox) Or MyTextBox = "" Then
The latter will catch if the user keyed a value and then cleared it [deleted the values from the text field] since it would no longer be Null but an empty text string.
 

Users who are viewing this thread

Back
Top Bottom