Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab out of subform to field on main form

Status
Not open for further replies.

TrekBiker

Technical User
Nov 26, 2010
330
0
16
GB
An Orders form has two subforms, one for Details and the other for Credits.

My client uses the Details subform all the time and the Credits one only very occasionally. The form's Tab Order allows her to move from the Details subform back into a PurchaseOrderNumber field on the main form, leaving the Credits subform well down the tab order so never being reached in normal usage.

She'd like to be able to click into the Credits subform when necessary, then tab out to PurchaseOrderNumber.

Putting an Exit event like this on the last field of the Details subform works fine if there's only one row in the subform.

Code:
Private Sub Credit_Type_Exit(Cancel As Integer)
    Me.Parent.SetFocus
    Me.Parent.PurchaseOrderNumber.SetFocus
End Sub

If there's more than one row it exits anyway after the first one.

Is there a way of getting it to exit only after all rows?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top