code to use to tab from question textbox to next combo box

robbie_1234

Registered User.
Local time
Today, 08:34
Joined
Jul 17, 2011
Messages
13
What wording in VBa is used to move on exit from a text box in question one to a combo box in question 2 on my form? Question 1 textbox is named txtAC01; Question 2 combo box is named numAC02. I have tried several combinations of words "move to," "jump to" however, I get an error message. Thanks
 
When I typed the words you indicated in the "on exit" event procedure box for that text box I get the following error message:

"The expression OnExit you entered as the event property setting produced the following error: Procedure declaration does not match description of event or procedure having the same name"

any suggestions? The name of the textbox I want to tab from is "txtAC01" and the control source is AC01. The name of the combo box I want to tab to is named "numA02LIK" and the control source is A02LIK.

thanks
 
This isn't something that you can fix by changing the tab order? If you use the on exit, it might not function as the end user would expect it to. What if they enter their data into the first control, and then try to click on control 3 for some reason? The first control's exit event will move the focus to control 2. Why would anyone want that?

But if you insist on doing this, then you would probably want to use the got focus event, and watch for the tab keystroke.
 
I only want to change the tab order if comments are written in the text box. Otherwise I want to keep the tab order as combo box to combo box to speed up the data entry as most questions do NOT have comments. I will be the only one entering data using this form.
 
I believe in the first controls after update event, you can check the value for non null data. If null, you can lock and or disable the second control. That should achieve your desired result.
 
Fixed it.

GinaWhipp had a spelling error in her code:

Code:
 DoCmd. GoToContol "numAC02"

instead of
Code:
 DoCmd.GoToCont[U]r[/U]ol "numAC02"

I put this code in as an event procedure in the "On Lost Focus" line of the property sheet for each of the text boxes that might have responses. When I tested it on the form, it worked perfectly!!!

Thanks so much for all of your help. This is the best site for getting answers to access forms. :) Now all I have to do is figure out how to compile all of the data collected from the form?!

Robbie
 
They say that the body is the first to go, not the mind, but in my dotage I find that my fingers habitually work faster than my brain! :D
 

Users who are viewing this thread

Back
Top Bottom