Opening subforms at new record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form with 2 subforms. When I open the form I need the subforms
to open at new record instead of the first record.
Is this possible?
I have tried the following "DoCmd.GoToRecord , , acNewRec" in both the "on
open" and "on load" events but neither seem to work. The command works when I
open the subforms alone but not as part of the main form.
Can any one help?
 
Bill,

If you don't need to be able to scroll back to the existing subform
records, you could set the Data Entry property of the forms you use for
the subforms, to Yes.
 
Bill,

In that case, I think one way would be to use code to set the focus to
each of the subforms in turn, and then use the GoToRecord. I would do
this on the Load event of the main form. For example (untested!)...

Private Sub Form_Load()
Me.FirstSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.SecondSubform.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.SomeControl.SetFocus
End Sub
 
Back
Top