Open SubForm help

M

micfly

Hi again, remember I'm new to this so bear with me :) Access97

I have a form with a subform opening with an On Click event (Thanks to
Steve's help on this Newsgroup):

Me!SbfrmCtl.SourceObject = "FrmTracking"

Works like a charm, but, when the FrmTracking opens, the focus is still on
the Main form (where the command button is)
so I have to click in the FrmTracking to start entering data. How do I set
the focus to FrmTracking, in say, the first control txtClientLastName when
it opens with the above On Click event?

I was also wondering if it's possible to set the forms "Data Entry" Property
(Under the Data tab in the forms properties) with VBA?

Thanks for any help.
Mickey Flynn aka micfly
 
B

Beetle

This should do the trick as long as txtClientLastName is the first control
in the tab order of the subform.

Me.SbfrmCtl.SourceObject = "FrmTracking"
Me.SbfrmCtl.Form.DataEntry = True
Me.SbfrmCtl.SetFocus
 
Top