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

By Passing a froms Tab order to a customised one ??

Status
Not open for further replies.

kimi2001

Technical User
Sep 18, 2001
6
GB
I have a form with a subform on a TabCtrl.
The user moves through the form with the cursor using the Tab button on their keyboard and when it gets to the last field on the mainform the cursor/or focus then moves to the TabCtrl itself instead of what i want, which is into the first field of the subform.

I have tried messing with the forms Tab Order but when looking at the order for the main form you only get the option of jumping from the last field straight over to the TabCtrl.

Is there a solution for this, maybe a set focus function or something like that??

Kimi
 
Kimi,
You can set code in the "On Lost Focus" Event in the last control on the parent mainform form that will set focus to the first control on the child subform.

I believe this will move you to the first field on the subform after tabing out of the last control.
Andy
 
Hi jabrony,

Thanks for the suggestion but it did not work. The cursor still move to the tabCtrl fist.

Any further suggestions please?

Regards,

Kimi
 
Kimi,

My apologies, my instructions were somewhat incomplete. When writing the code (or Macro) for the "On Lost Focus" event of the last control of your main form you must first set focus to the subform. The code should look something like this:
[red]
DoCmd.GoToControl "Name_of_Subform"
DoCmd.GoToControl "Control_Name_on_Subform"
[/red]

I've tried it out on a test database and it worked for me.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top