Validation with option button group

D

dwaynesworld

Please help.
I would like to insert a code where if a user does not select a location,
they will receive a message box that an entry is required. The locations are
in an option button group. Thanks!!!
 
S

Stefan Hoffmann

hi,
I would like to insert a code where if a user does not select a location,
they will receive a message box that an entry is required. The locations are
in an option button group. Thanks!!!

Private Sub Form_BeforeUpdate(Cancel As Integer)

If IsNull(nameOfOptionGroup.Value) Then
Cancel = True
MsgBox "Please enter a location."
End If

End Sub


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top