resetting the tab Order?

bhamilton42

Registered User.
Local time
Today, 04:19
Joined
Jul 30, 2012
Messages
16
Hello all, I've recently been working with access and VBA alot, and I'm running into difficulties with the tabbing on a form. I have a form with a subform, and that subform has 3 other sub forms. My problem is tabbing from subform to subform.

I'm interested mostly in 2 of my subforms. they are both coninuous forms, with 1 bound textfield, and with 4 records, and are situated one next to the other. Tabbing starts on the left one, it tabs down through the 4 records, which is good, and then i put code so when you hit tab again when the last row is selected it tabs to the first record in the subform to the right. then tabs through all four of those fine.

The problem arrises when trying to start over. If you click back to the left subform and tab through, it is fine, but when it goes to the subform on the right it starts at the second record not the first. Also if you click back to the top of the main form and tab through, when it gets to those 2 subforms it skips the one on the left (the first time through it works perfect) and goes strait to the subform on the right.

It's like the tab order changes whilst tabbing through the items on the form.. It seems a matter of resetting the tab order. IF you close the whole thing and open it the tabbing starts at thetop and tabs through everything perfec.t but I cant have my use do that every time.

Any help appreciated :)
 
and then i put code so when you hit tab again when the last row is selected it tabs to the first record in the subform to the right. then tabs through all four of those fine.


What does your code look like? Does it have a counter that needs to be reset? I think we need a little bit more information. Can you post a a few lines of the code used?
 
Thank you much for the reply, I just figured it out in the last hour. after you tab through a sub form, i think if you tab back in from the main form, it goes to where you left off. I used the "requery" method to reset the subform which fixed the tabbing. for the 2 continuous form subforms, i figured out it was because the current record property wasn't going back to 1. and even if you clicked the first field, when you tabbed back in, it went to the second field. I used requery on those also. As for moving between the 2 subforms, I did have a counter yes. But I took it out and simply used the keydown event to say, if the current record is the last record and the user hits tab, then focus changes to a different control.

Thanks again
 
Nice job figuring it out. Makes you feel good when you overcome a challange.
 

Users who are viewing this thread

Back
Top Bottom