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

Setting focus from one sub form to another subform

Status
Not open for further replies.

MikeSawt

Technical User
Jun 24, 2003
25
US
I am using Access 2000

I have a main form: PateintDemo
I have two sub forms: SurgeryLog and OR_StaffRolesub

The last field name in the SurgeryLog subform is WoundClass
The first field name in the OR_StaffRolesub subform is Mneumonic

I want the tab control to go from [SurgeryLog]![WoundClass] to [OR_StaffRolesub]![Mneumonic]

I think I want the code to be on Event “On Exit” but I can’t seam to get the code correct.

Can someone lead a hand?

Thanks
Mike

 
Mike
In order to get to a particular control in a subform, you have to set focus to the subform itself first, and then to the control.

Try something like...
Code:
Forms!SurgeryLog!OR_StaffRolesub.SetFocus
Forms!OR_StaffRolesub!Mneumonic!SetFocus

You might have to play with this a little to get it right, but that's the progression.

Tom

 
How are ya MikeSawt . . . . .

Are the subForms in [blue]Single[/blue] or [blue]Continuous[/blue] view?

Calvin.gif
See Ya! . . . . . .
 
In the LostFocus event procedure of WoundClass:
Forms!PateintDemo!OR_StaffRolesub.SetFocus
Forms!PateintDemo!OR_StaffRolesub.Form!Mneumonic.SetFocus

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I am having this issue myself. I have a main form. Then I have 3 pages on a tab control ( 4 if the type of entry validates that is is to be shown) Each page has a subform. The subforms can be either single or continuous, I think I am still deciding what I want to lock down this entry form to make entry easy.

The form is for entering applicants for jobs to our company. The main form is just for name and email and candidate type. If the candidate type is one of a few types a page becomes visible for specific info, otherwise, there are just 3 pages. 1 is for addresses. An applicant can have multiple addresses (home, work, school etc), another is for phone numbers. An applicant can have multiple phone numbers.

The last page is for the applications for that candidate. A candidate could apply more than once, so they could have more than one application. This will get tricky because the application form has a subform, for the activities relevant to that application. This is like a logical history. Activity - interview scheduled, interview held, offer extended, rejection letter sent, etc.

Anyway, for this particular issue, I am looking to make it so that when the user is tabbing it goes from the last field on one subform to the first field on the next subform. My hestitation is that I think I need to make sure that there aren't more address, phone numbers, applications or activities needed to be added at that time. My next hesitation is that I don't want to be stopping the user with messages every 5 seconds.

Any thoughts?
I am willing to email the db, but it is too large (table structures and forms alone, with no data) to post anywhere.
Thanks for any help.

misscrf

It is never too late to become what you could have been ~ George Eliot
 
How are ya misscrf . . . . .

[blue]Not trying to sound this way or that[/blue] . . . . . [purple]your post is not fair to MikeSawt.[/purple] It has every tendency to take-over/obscure specifics of the post origination.

[blue]Start a thread for yourself . . . . by now I'm sure you know it'll be picked up![/blue]

Calvin.gif
See Ya! . . . . . .
 
sorry about that, I just thought people got mad if you posted when there were posts out there that related to the issue. I will repost right now.
Thanks.

misscrf

It is never too late to become what you could have been ~ George Eliot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top