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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab into subform & back to main form

Status
Not open for further replies.

thefourthwall

IS-IT--Management
Feb 26, 2002
387
US
Hello,

I have tried suggestions already posted, yet am doing something wrong still.

I have a main form, frmEquipmentCheckIn and two subforms, frmHardware_Subform and frmPeripherals_Subform and want to tab out of the last field in the main, into the first field in the first subform (first field on subform is drop off date), then tab into the 2nd subform, and finally back to the main form.

For main form's last field(Phone#), I have code behind the Got_Focus event:
Code:
Forms!SubformfrmHardware_Subform.SetFocus
[SubFormfrmHardware_Subform].Form!Date_Dropped_Off].SetFocus
Have to admit being clumsy at this, and appreciate any help.

Thanks,
thefourthwall
 
Replace this:
Forms!SubformfrmHardware_Subform.SetFocus
with this:
Me!SubformfrmHardware_Subform.SetFocus

Provided that the control hosting the subform is really named SubformfrmHardware_Subform

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

That worked! You were right about suspecting the hardware subform might be named differently: it is - it's 'hardware_subform'

Is it possible to tab out of the last field in hardware_subform and into the first of peripherals_subform?

I have
Code:
Me.Parent![Peripherals_Subform].SetFocus
Me.Parent![Peripherals_Subform]![Laptop_Bag].SetFocus
but am getting run-time error 2465. Assume is because I am incorrectly referencing the 2nd subform from the first .. but how?
 
Me.Parent![Peripherals_Subform][!].Form[/!]![Laptop_Bag].SetFocus

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, PHV.

The new error indicates that Peripherals_Subform is a field ... sorry for being slow on this...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top