Check Value of Option button

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

Guest

I have a single Option button on a form used to indicate a "special
circumstance" which might occurr for some of the records, it is bound to a
yes/no field in the underlying table. What I need is some way to determine
if this button is already selected for a particular record when the form
opens. If the button is already selected, and the user de-selects it then I
need an input box to open and the user to be forced to enter a brief
explanation about the special circumstances for the particular record. I
don't need the input box when they first select the option, only if they
de-select option for a record which it was previously selected.

Any ideas on this would be greatly appreciated, thanks.
 
First, I assume you mean a checkbox, not an option button. Option Groups
contain multiple radio buttons. The user can select only one from the
group. I've never seen a single radio button.

That being said, just add code to the checkbox's CHANGE event to say, If
"no" then... And display a message box and whatever other code you want to
perform.
 
Sorry, Rick. There is no change event for a check box. I tried an approach
that works. In the Current event, set the Tag property of the check box to
the value of the field. then in the Exit event (May not be the exact best
place depending on what else is happening):

If Me.Check21.Tag = True And Me.Check21 = False Then
Present the Input Box
Put the value returned from the Input Box where you need it
End If
 
I would recommend the AfterUpdate event (it won't fire if
the user just tabs throught the control without changing it.

Also, the control's OldValue property will serve the purpose
without involving the Current event ot the Tag property.
 
Actually it is an Option button. You can use single option buttons without
the option group, which is what I did in this case because I only have one
option. I suppose the individual option button works pretty much the same as
a check box though.

The OldValue property in the Before Update event works great. Thanks.
 
Back
Top