Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Tab Order 2 Subforms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Charles L. Phillips - 11 Jul 2007 23:29 GMT
Hello,
I am using MS-Access 2003.
I have 1 mainform and 2 subforms, on the mainform.
I can tab perfectly from the mainform to the 1st subform, but cannot
continue to tab through the 2nd subform, then back to the mainform...

I need to tab through the mainform, both subforms, then back to the
mainform.
I have tried several searches for this process, but have had no success or
I'm overlooking the answer.
Can/will someone direct me to some examples or samples???

Thank you,

Charles L. Phillips
Graham Mandeno - 12 Jul 2007 00:07 GMT
Hi Charles

Unfortunately there is no automatic way to tab OUT of a subform.  You can
tab into it because the subform control is part of the tab order of the main
form, but once you are there you are trapped by the subform's tab order and
can't escape without intervention by user or code.

A good workaround is to add to your subform an invisible control that can
get the focus - a small transparent command button is ideal.  Place this
control last in the tab order on your subform and write some code for its
GotFocus event:

With Me.Parent![Subform2]
   .SetFocus
   .Form![FirstControl].SetFocus
End With

...where "Subform2" is the name of the subform control containing the second
subform and "FirstControl" is the name of the control on the second subform
that you want to tab to.
Signature

Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

> Hello,
> I am using MS-Access 2003.
[quoted text clipped - 11 lines]
>
> Charles L. Phillips
Charles L. Phillips - 12 Jul 2007 17:25 GMT
Hello,
"Thank You" for your timely response, but would it be more simple to make
this process 1 mainform, or combine the mainform and the 1st subform...

Thank you,

Charles L. Phillips

> Hi Charles
>
[quoted text clipped - 31 lines]
>>
>> Charles L. Phillips
Graham Mandeno - 12 Jul 2007 23:22 GMT
Hi Charles

That's very difficult to say.  Subforms are usually used to contain data
which is related in some way to the recordsource of the main form.  This
might be a one-to-many relationship, in which case you could not use a
single main form.  One form will always be a "simpler" option, but it might
not be practical!

If you were to post some more details about your table structures and a
description of your form design, we might be able to help further.
Signature

Good Luck  :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

> Hello,
> "Thank You" for your timely response, but would it be more simple to make
[quoted text clipped - 39 lines]
>>>
>>> Charles L. Phillips
John W. Vinson - 12 Jul 2007 01:14 GMT
>Hello,
>I am using MS-Access 2003.
[quoted text clipped - 7 lines]
>I'm overlooking the answer.
>Can/will someone direct me to some examples or samples???

Each subform has its own independent tab order. Typically a subform is used to
enter an arbitrary number of records in the child table, so if you take the
defaults, tabbing out of the last field in the subform's tab order will put
you into a new record on the same subform.

If you want to override this behavior, and (as a side effect) make it more
difficult for the user to add two subform records, you can put an unbound
textbox last in the first subform's tab order. Call it txtRelay, and probably
hide it behind some other control so the user can't mouseclick into it. In its
Got Focus event put:

Private Sub txtRelay_GotFocus()
Parent!SecondSubform.SetFocus
Parent!SecondSubform.Form!controlname.SetFocus
End Sub

to set the focus first to the other subform, and then to the desired first
control in the second subform's tab order. Do something similar on the second
subform.

            John W. Vinson [MVP]
Charles L. Phillips - 12 Jul 2007 17:31 GMT
Hello,
Yes, I do want to make this form (process) easy for the User(s), so do you
think making 1 mainform would be best...

Thank you,

Charles L. Phillips

>>Hello,
>>I am using MS-Access 2003.
[quoted text clipped - 35 lines]
>
>             John W. Vinson [MVP]
John W. Vinson - 12 Jul 2007 22:16 GMT
>Hello,
>Yes, I do want to make this form (process) easy for the User(s), so do you
>think making 1 mainform would be best...

Since I have no idea how your tables are structured, how the data in them is
logically related, how skilled your users might be, all I can say is I don't
have any idea.

            John W. Vinson [MVP]
Charles L. Phillips - 16 Jul 2007 22:50 GMT
Hello,
Sorry for the delay, but I've decided to make 1 form.
Your input has been very insightful...

Thank you,

Charles L. Phillips

>>Hello,
>>Yes, I do want to make this form (process) easy for the User(s), so do you
[quoted text clipped - 7 lines]
>
>             John W. Vinson [MVP]
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.