SetFocus question

D

DAW

This should be basic, but I must be missing something. I have a main form
with three subforms. When the user updates a field in my subform
(continuous), I want to move focus to another subform on my main form. I
have the event procedure on After Update and no matter what I use for my
expression, Access cannot find the subform that I want to set focus to. Any
ideas?

Thanks!!
 
K

Ken Snell [MVP]

You need to set the focus twice in order to get focus onto a control in a
subform. For your situation, the steps would look something like this when
run from the first subform:

Me.Parent.SecondSubform.SetFocus
Me.Parent.SecondSubform.Form.ControlName.SetFocus

where SecondSubform is the name of the subform control (the control that
holds the second 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