Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keeping Focus 1

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
Hi

I have a textbox which is accepting barcode scans. I want the textbox to accept x number of scans before some other code is executed. How do I keep the focus on the text box after it has accepted a scan? I tried using the setfocus method in the text box's afterupdate event but that doesn't seem to work.

 
There is a quirk in Access that prevents you from setting the focus to a control that just lost the focus. You can overcome this by setting the focus to another control on the form then immediately set it back to the original control. Keep in mind. When you set the focus back it may "select" the value that is in the control, if you type or send data it may "overwrite" what was in it. Seems to me a better method would be to treat each scan as a separate field. You can do this with unbound textboxes. Then when all have been filled in concatenate them into a single string and assign this to a bound control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top