View Full Version : Tabing in and out of subforms


Carrie Schoeppach
06-18-2001, 03:32 PM
I have a main form that has tree subforms placed at different places within the main form. I want to be able to tab directly from a field in the main form into the subform. This I can do actually. I am having the problem with being able to tab out of the subform back into my main form. I have gone to the Tab Index control and placed the controls in the order that I want. This still won't let me get out of the subform and back into the main form though. Any help would be appreciated!!

Thanks
Carrie

charityg
06-18-2001, 05:34 PM
This is just theory, but it seems if you code the OnExit event of the last control of your subform to something like

Parent!fldMain.SetFocus

where fldMain is the name of the control or field you want to tab to on the main form it should work.

try it and let me know

Charity

Jack Cowley
06-18-2001, 06:57 PM
This Article from the Microsoft Knowledge Base will show you how to move from a Subform to the Main form using the Tab or Enter key.
http://support.microsoft.com/support/kb/articles/Q154/8/93.asp?LN=EN-US&SD=gn&FR=0&qry=q154893&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC97

Good luck.

Carrie Schoeppach
06-19-2001, 11:59 AM
Thank you both of you for responding to this request. I tried both of your suggestions and I think that I am just really poorly versed in Visual Basic. I Printed out the instructions given by Microsoft Support Services and entered that into the OnExit property. I am getting an error message that states "Ambiguous word" or something like that. I looked this up on the help and I really don't understand what it is saying to me. The same error message came up when I tried the first suggestion of typing in that expression. I am sure that it is close. I just don't know how to trouble shoot what I have done wrong. If you have any suggestions to the error message I would appreciate it. Thanks again for your comments.

Carrie

Jane
06-19-2001, 01:22 PM
I've been trying to do the same thing and I'm not very good at this but I found that if you are in a field of your subform and hit ctrl tab it will take you the to the main form. However, if the actual name of the subform is selected ctrl tab will take you to the next subform. So if the name of the sub form is selected you can hit tab to go to the first field of that subform then ctrl tab to go back to the main form. Basically I played around with using tab, shift tab, crtl tab, crtl shift tab and tried to figure out what each command did depending on where I am in my form. Hope this helps ?!?

Carrie Schoeppach
06-19-2001, 01:58 PM
THANKS!! I think that is great. It is very easy to remember and I just posted a message box to come up after the update of that control. That is easier than putting in a bunch of code. Thanks to every one for all their thoughts!!!


Carrie