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

How to navigate back to subform from parent form 1

Status
Not open for further replies.

pondside

Programmer
Jul 6, 2003
11
US
I have a situation where I need to navigate upwards from one of 4 tabbed subforms to accomplish certain tasks in the parent form. This I can do via setfocus from the current subform event procedure.

But when I attempt to use a setfocus method back to a specific control in the subform, nothing happens, my cursor simply remains where it is, no error message, nothing. Can someone give me a sense of what may be wrong?

I correctly set a subform date field like this:
Forms![frmFin18]!FetchSem1.Form!Sem1Date = Me.txtTargetDate

Then I attempt to set focus in an adjoining subform control like this:
Forms![frmFin18]!FetchSem1.Form!Sem1Paid.SetFocus
or this:
Forms!frmFin18!FetchSem1!Sem1Paid.SetFocus

Nothing happens, I remain in the main form control whose GetFocus event I have been processing.
 
Hi,

You need to activate the SubForm itself. The focus is given to the control in the subform, but is only highlighted when the subform itself has the focus.
Code:
Forms![frmFin18]!FetchSem1.Form.SetFocus

Forms![frmFin18]!FetchSem1.Form!Sem1Paid.SetFocus

Dean :)
 
Dean,

Thanks, I found I had to modify the first statement, dropping the "Form.", but it works great, and it's a relief to find an answer I couldn't find in any of my Access books.
[smile2][smile2]

Forms![frmFin18!FetchSem1.SetFocus
Forms![frmFin18!FetchSem1.Form!Sem1Paid.SetFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top