Question How Can Cursor Focus Default Be Set To Search Bar Instead of a Field?

dlhappy

Registered User.
Local time
Today, 00:11
Joined
Mar 14, 2010
Messages
50
I would like the cursor for all forms, etc., queries, etc., to be by default, on the search bar above the status bar in Access 2007. That is the section that has three boxes -- the record # box, the filter box, and the search box. Right now the cursor is on the first field of any form, etc. opened.

I am not familiar with VBA programming, so if you have a solution that requires coding, please be very specific and tell me exactly what to do.

Thanks!
 
The problem is that the search dialog box at the bottom of a form isn't one of your controls, so the control-name.SetFocus method won't work on it. Further, the navigation controls are optional on any of your forms, and can be turned on/off dynamically. You cannot set focus to a control unless it is visible. In fact, if you had a form in which all of your defined controls was disabled, that is the only time focus can go to the form itself. Even then, the "background" of the form is what is in focus.

Respectfully, if you wanted to be able to do a search on any form, you might do better to include a text box that can be used to find a specific record and then define the Tab Order to make that the first control on your form. The good news is that you can create a combo box with this function using a wizard. While the wizards are often dumber than a box of garden tools, they DO build workable VBA code for you.
 

Users who are viewing this thread

Back
Top Bottom