Check Box Validation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I need to create a requirement that if the user enters information into a
specific text box, the user then has to select one of three check boxes. The
text box is called Provider and the three check boxes are called Ind, Pat,
Ret.
 
Hi, Karen.

If the three checkboxes are mutually exclusive, i.e., only one can be
selected regardless of the status of the textbox, you may wish to use an
option group instead. Use the form's BeforeUpdate event to check the fields:

If Nz(Me!Provider)<> 0 Then
If (Me!Ind=False AND Me!Pat = False AND Me!Ret = False) Then
Cancel = True
' Set focus to the first of the three controls
Me!Ind.SetFocus
End If
End If

If using an option group, you would instead use the test

If Nz(Me!YourOptionGroup) = 0 Then

for the inner If..End If block.

Sprinks
 

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

Back
Top