Close a form and make sure an option is selected

G

Guest

I have an option group on a subform of an Access form. I want to force the
user to select one of the options before they close the form. I can't seem
to figure out what event procedure to put the following code in:

If Findings.value = null then MsgBox, "yada yada yada" EndIf

I've tried the Onclose and OnUnload events of the subform.
I've tried the AfterUpdate Event of the Option Group.
I've tried the OnClose Event of the main form.

Any help would be wonderful. Thank you.
 
G

Guest

Do you have default button in your option group? If nothing is selected, it
will return the value of the default button. If you do not have a default
and you set your values to 1,2,3, etc and nothing is selected, it will return
0 - Non Numeric values are not allowed as vaules for option buttons. So, If
you require that the user select an option rather than allow a default, be
sure there is no Default Value in your option group. This is easy to see
because all buttons will be greyed. I tried it in the Exit event of the
Option Group (Frame) and it worked there. Now, if you are cycling records,
you will need to put a line in an event prior to the next record to set it
back to null:
me.FrameX = Null
 

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