Tabbing from Subform to Subform

G

Guest

Hi all,

Could use some help when creating GotFocus events in a subform. I've read a
few posts and am trying some combinations in code to make it work.

Using access 2000, I have a main form with several subforms. In the first
subform, I have an unbound text contral, active and visible, with the
following code on the GotFocus event:

Private Sub Text5_GotFocus()
Parent!Scan.SetFocus
End Sub

I'd like this code to take me to the next subform (scan) and begin the tab
process again. Am I on the right track? I seem to be missing something
because it doesn't proceed to the next tab control. Please help.
 
J

John Vinson

Hi all,

Could use some help when creating GotFocus events in a subform. I've read a
few posts and am trying some combinations in code to make it work.

Using access 2000, I have a main form with several subforms. In the first
subform, I have an unbound text contral, active and visible, with the
following code on the GotFocus event:

Private Sub Text5_GotFocus()
Parent!Scan.SetFocus
End Sub

I'd like this code to take me to the next subform (scan) and begin the tab
process again. Am I on the right track? I seem to be missing something
because it doesn't proceed to the next tab control. Please help.

I've always found that you need TWO setfocus events: you need to
setfocus to the second Subform Control, and *then* to the name of a
control on that subform (the first control in the tab order normally):

Parent!Scan.SetFocus
Parent!Scan.Form!txtXYZ.SetFocus

Note that Scan is the Name property *of the Subform control*, which
might or might not be the same as the name of the Form within that
control.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top