Not allow Blank Fields

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
 
G

Graham R Seach

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
 
G

Graham R Seach

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
 
G

Gurtz

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 $]
 
G

Gurtz

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 $]
 
D

David T

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





.
 
D

David T

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





.
 
Top