Form & Subform-input disappearing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with subform. When inputting new data on the subform and get
to last field, want to tab to next subform. But, that last tab returns you
to the first field of the first (or current subform) with blank fields (I
assume a new form in the subform is opening up for additional data). How can
I get it to display what was just input and tab out to the next subform? (I
have checked my tab order which seems to be okay).

Thank you.
pattylb
 
I have a form with subform. When inputting new data on the subform and get
to last field, want to tab to next subform. But, that last tab returns you
to the first field of the first (or current subform) with blank fields (I
assume a new form in the subform is opening up for additional data). How can
I get it to display what was just input and tab out to the next subform? (I
have checked my tab order which seems to be okay).

The tab order of each subform is independent.

You can type Ctrl-Tab to return control to the next object in the
*main* form's tab order (which might well be the other subform); or,
to get a bit fancier, put a textbox last in the tab order of the first
subform. Make its height and width zero so the user can't see it or
mouseclick it; in its GotFocus event set focus to the other subform's
first control. E.g.

Private Sub txtRelay_GotFocus()
Parent!subSecondSub.SetFocus
Parent!subSecondSub.Form!txtFirstControl.SetFocus
End Sub

You need both setfocus events.

John W. Vinson[MVP]
 
Thanks very much; I like your method.

I do have two questions: Could I set visible to No on the text box and get
the same results, and secondly, the code as per your example modified for my
database, returns the 438 error message (Object doesn't support property or
method). Does that mean my version of Access doesn't allow for the Parent
code?

Thanks again.
pattylb
 
Thanks very much; I like your method.

I do have two questions: Could I set visible to No on the text box and get
the same results,

Yes - or if you just want those records to be unavailable, for either
editing or viewing, simply base the Form on a query that selects only
those records that are not Complete.
and secondly, the code as per your example modified for my
database, returns the 438 error message (Object doesn't support property or
method). Does that mean my version of Access doesn't allow for the Parent
code?

No, that's been around a long while. Please post your code; I very
well may have erred in describing it.

John W. Vinson[MVP]
 
Back
Top