Not allow Blank Fields

  • Thread starter Thread starter David Tunstall
  • Start date Start date
D

David Tunstall

Please help. I have a form that collates equal
opportunity data. I want a message box to pop up if one
or more of the fields hasn't been completed or ticked.
Something like:

If Gender.Value = Null Then msgbox("Please complete
gender")

Else

DoCmd.Exit

Many Thanks
David
 
David,

You nearly had it.

If IsNull(Gender.Value) Then
MsgBox "Please complete gender"
Else
DoCmd.Exit
End If

Graham R Seach
Microsoft Access MCP, MVP
Sydney, Australia
 
Hi David,

I'm assuming the user is hitting some sort of submit
button, at which point (in the button click event) you
could use the following code:

If IsNull(Me!ControlName.Value) Then
MsgBox("Please enter ..")
Else
DoCmd.CloseForm
End If

Gurtz
[email = no $]
 
Thanks Guys
-----Original Message-----
David,

You nearly had it.

If IsNull(Gender.Value) Then
MsgBox "Please complete gender"
Else
DoCmd.Exit
End If

Graham R Seach
Microsoft Access MCP, MVP
Sydney, Australia





.
 
Back
Top