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!

returning to main form from subform

Status
Not open for further replies.

emitecaps

Technical User
Apr 20, 2005
24
GB
Hi,

I've a form with 2 subforms - the subform to be used depends on the selection of a combo box. This all works fine - however after completing this section the user should be able to tab to the next field which is back on the main form. I can change fields using the mouse but not with the tab key.

Should I have some code in the afterevent property of each subform?

thanks
Barry
 
Did you check FAQ "Moving Between Main Form and Subform with TAB or Enter Keys" ?
faq702-1064
Posted: Aug 30, 2001

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
thanks...I can't seem to get the code to work from the ATTAC example unfortunately. Each subform has only one field - I've copied the code into the declaration in the main form. For each of the subforms I've entered the second bit of code into the after update field ....now I keep getting this error:
run-time 2465 ms access can't find the field "somecontrol" referred to in your expression.

Do you think I should add both bits of code to the one field in the subform?


thanks
Barry
 
Or...could I use a macro that moves back to the main form once the subform has been completed????
 
can't find the field "somecontrol" referred to in your expression
Seems the form doesn't have a control named somecontrol ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Me.Parent!SomeControl.SetFocus

Do you have any CONTROLS on the main form? any textbox? combobox? commandbutton? if yes place it's name instead of "someControl"
Me.Parent!TextBoxName.SetFocus

________________________________________
Zameer Abdulla
Visit Me
There is only one perfect child in this world. Every mother has it.
 
thanks...
i've changed the code so that it refers to the control Issue_Date in the main form. I've checked the spelling etc of the control but it's saying

"MS Acess can't find the field Issue_Date in your expression"

thanks

 
guys...
apologies have changed my control name and found it works ok now!

thanks a million - you've been great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top