Setting Focus to a field in a subform in 2007

L

LilBomShl

How do I set focus on a tab from the last field in a Main form to the first
field in an embedded subform in 2007?
 
L

Linq Adams via AccessMonster.com

The the OnExit event of the last control on Main form use this code:

Me.NameOfSubFormControl.SetFocus
Me.NameOfSubFormControl.Form!NameOfFirstControlOnSub.SetFocus

Be sure that you replace

NameOfSubFormControl

with the actual name of the subform ***control*** which is not necessarily
the same as the name of the form being used as the basis for the subform.

As you can see, you have to set focus to the subform control ***then*** set
focus to the textbox on the subform.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top