Moving focus from subform to main

D

DEVOURU

I would like to be able to have the focus go from the last field entry in a
subform to a control source in the main form. Ideas?

TIA, -JS
 
S

StCyrM

Hi Devouru

Look at the SetFocus method in Help

For example, if you want to set focus on a particular form on your main form,
the syntax would be as follows:

forms!MyMainForm!MyMainFormControl.SetFocus

Hope this helps

Best Regards

Maurice St-Cyr
Micro Systems Consultants, Inc.
 
A

Albert D. Kallal

In the last fields after update event on the sub-form, you can go:


me.Parent.SetFocus
me.Parent.CompanyName.SetFocus
 
D

DEVOURU

Thankx for the reply. I found my mistake. I was using the complete systax
forms!mymainform!control instead of control name only., I'm good to go.

-JS
 
D

Dirk Goldgar

Albert D. Kallal said:
In the last fields after update event on the sub-form, you can go:


me.Parent.SetFocus
me.Parent.CompanyName.SetFocus

I don't believe it's necessary to SetFocus to the parent first. When
moving upward from a subform, unless I'm mistaken, it's enough to
SetFocus to the control on the parent form.
 

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