On click event

  • Thread starter Thread starter Starr M via AccessMonster.com
  • Start date Start date
S

Starr M via AccessMonster.com

How can I change the value of a text box using the on click event of the
textbox.
 
How do you want to change the value? To a single value if the user clicks,
or present the user a choice of values? To change it to a single value, open
the form in design view, show properties with View, Properties, click the
Event tab, cursor into the event and click the ellipsis to the right of the
field, selecting Code Builder if given options. Then simply assign the value
you wish, e.g., placing the following code between the Sub and End Sub lines.

Me![MyTextBox] = MyValue

If you wish to present the user a choice of values, I would use a combo box
instead of a textbox in the first place.

Also, the OnClick event would be triggered if a user used the mouse to enter
the field, which may not be what you want. If so, the OnDblClick would be a
better option.

Sprinks
 
Back
Top