Option Box Rule

S

Stockwell43

Hello,

I have an Option Box on my form that gives the user two choices: "Closing"
of "Doc Prep". I want to FORCE the user to select one of the two choices in
the Option otherwise it will not allow them to save the record(so in
otherwords, I don't want the option box blank or Null). Now I know I can do
this by selecting the Required field in the main table but I also need a
message box to pop up to "You must select either Closing or Doc Prep". I
don't know how to add that in if I use th required field. I was hoping
someone knew how to do all this in VBA and when I would place the code. Any
help would be most appreciated.

Thanks!!!
 
F

fredg

Hello,

I have an Option Box on my form that gives the user two choices: "Closing"
of "Doc Prep". I want to FORCE the user to select one of the two choices in
the Option otherwise it will not allow them to save the record(so in
otherwords, I don't want the option box blank or Null). Now I know I can do
this by selecting the Required field in the main table but I also need a
message box to pop up to "You must select either Closing or Doc Prep". I
don't know how to add that in if I use th required field. I was hoping
someone knew how to do all this in VBA and when I would place the code. Any
help would be most appreciated.

Thanks!!!

Code the Form's BeforeUpdate event:

If IsNull([OptionGroupName]) Then
MsgBox "Gotta pick one or the other"
Cancel = True
End If
 
S

Stockwell43

Hi Fred!

Thank you very much for your help. Code works great!!

fredg said:
Hello,

I have an Option Box on my form that gives the user two choices: "Closing"
of "Doc Prep". I want to FORCE the user to select one of the two choices in
the Option otherwise it will not allow them to save the record(so in
otherwords, I don't want the option box blank or Null). Now I know I can do
this by selecting the Required field in the main table but I also need a
message box to pop up to "You must select either Closing or Doc Prep". I
don't know how to add that in if I use th required field. I was hoping
someone knew how to do all this in VBA and when I would place the code. Any
help would be most appreciated.

Thanks!!!

Code the Form's BeforeUpdate event:

If IsNull([OptionGroupName]) Then
MsgBox "Gotta pick one or the other"
Cancel = True
End If
 

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