Option box detail

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

Guest

I'm trying to utilize an option box by having the option of "Other". But I
want it so that if I select that option in the option box, it will allow a
person to type in a text box adjacent/connected to the field. If the option
is not selected, than one can not input into the text box. Anyone have any
ideas on how to do this for multiple fields in a form? I found out how once,
but didn't understand it.
 
Hi, CD.

Each textbox has a Visible property which you can set based on the selection
of "Other". By definition, if the control is not visible, focus cannot pass
to it. In the AfterUpdate event procedure of the textbox, and in the form's
OnCurrent event procedure, add the following code:

If Me![YourOptionGroup] = "Other" Then
Me![YourTextbox].Visible = True
Else
Me![YourTextbox].Visible = False
End If

Note that I have assumed that the *value* of the option group is "Other".
Usually what is next to the button is a label, while the value given to the
option group is actually an integer. If this is the case, change "Other" to
the value to which it corresponds.

Hope that helps.
Sprinks
 
Back
Top