View Full Version : Text box question.


geno
01-28-2002, 01:30 PM
Hi, I have a combo box that when an item is selected and the user clicks on a command button another form opens with a definition of the product selected from the combo box. When the text box gets focus all the text is highlighted, I believe this is because the record in the query is highlighted also. Is there a way to stop this from happening?
Thanks

David R
01-28-2002, 01:38 PM
Most fields on a form default to being highlighted. There are a couple of places to attack this:
For the entire database, Options>Keyboard>Behavior-entering-field, but this possibly only affects user movement, not code.
In the OnEnter event for the field, put something similar to this:
Me.ActiveControl.SelStart = N
Where N = the position you want to start at. In Access VBA help there are examples to show you how to use this effectively.

HTH,
David R

geno
01-28-2002, 01:51 PM
Thanks David, your first and easiest suggestion worked.