Setting Focus to a Subform

S

Scott Viney

Afternoon All,

I have a simple form with a subform in datasheet view.
Its a real pain scrolling down in the subform everytime I want to add new
data.

How can I when the main form is first opened set the focus to a new record
in the subform? Then also when I change the record of the main form do the
same thing in the newly displayed subform?

Cheers,
Scott V
 
G

Guest

On the On current event of the main form you can write the code

Me.SubFormName.SetFocus
DoCmd.GoToRecord , , acNewRec

Good luck
 
S

Scott Viney

Cheers Mate,

Works like a charm.

Scott V
Ofer said:
On the On current event of the main form you can write the code

Me.SubFormName.SetFocus
DoCmd.GoToRecord , , acNewRec

Good luck
 

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