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

Navigate from Subform to another Subform using Enter key 1

Status
Not open for further replies.

wz

Programmer
Feb 16, 2001
88
US
I am developing a form that has several subforms in it. I would like the end user to hit the enter button to go from one field on a subform to the next field in a different subform - how can I do this?

I tried properties, event, on enter

 
How about the keypress event, interrogating KeyAscii for the enter key?

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Thanks, I just want the end user to use the enter key & I need help with the code.

I used the go to control command but it does not see the field since it is in a different subform?? any ideas,wz
 
You should set the focus to the subform first:
Code:
Forms![Name of mainform]![Name of subform container].SetFocus
Forms![Name of mainform]![Name of subform container].Form![name of control].SetFocus

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hopefully I'm not missing something here.
Do you mean
Code:
IF KeyAscii = vbKeyReturn Then

   do your set focus code here...

End If
In the forms KeyPress() event doesn't work?

"Don't be irreplaceable. If you can't be replaced, you can't be promoted."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top