Open Text Box if "Other" Chosen in a Combo Box

  • Thread starter Thread starter Jennifer
  • Start date Start date
J

Jennifer

I am designing a data entry form with multiple combo boxes
containing an "Other" option. I need to set up my form so
if someone chooses "Other" from a combo box, a text box
will open allowing the choice to be described. For
example:

Hair Color:

Brown
Blond
Red
Blue
Other Specify: _________

Thanks to anyone who can help!

Jennifer
 
i'll call your textbox txtSpecify and the combobox cboColor. create a macro,
as

Macro Name: see Specify
Condition: [cboColor] = "Other"
Action: SetValue
Item: [Forms]![MyFormName]![txtSpecify].[Visible]
Expression: True
(next line)
Macro Name: {blank}
Condition: ... (ellipsis. type three dots, literally.)
Action: StopMacro
(next line)
Macro Name: {blank}
Condition: {blank}
Action: SetValue
Item: [Forms]![MyFormName]![txtSpecify].[Visible]
Expression: False
(next line)
Macro Name: {blank}
Condition: [txtSpecify] Is Not Null
Action: SetValue
Item: [Forms]![MyFormName]![txtSpecify]
Expression: Null
(next line)
Macro Name: {blank}
Condition: {blank}
Action: StopMacro

call the macro from the form's OnCurrent event, and from the combo box's
AfterUpdate event. and, of course, your text box has to be bound to a field
in the form's underlying table (or else you have to assign the value to the
field using a macro or VBA).

hth
 
Back
Top