Records goto next command

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

Guest

I want to have my code send the focust to a new record in code. When running
"DoCmd.RunCommand (acCmdRecordsGoToNew)" it does not know what form I am
refering to - What is the syntax for this (the form is
"Forms![ST_Enter_TR]![ST_TRANS_HD subform]")
 
Set focus to the subform control first, then to a control in the subform,
and then the go-to-new should work unless it's already at the new record.

Example, for code in the main form's module:

Me.[ST_TRANS_HD subform].SetFocus
With Me.[ST_TRANS_HD subform].Form
![Text0].SetFocus
If Not .NewRecord Then
RunCommand acCmdRecordsGotoNew
End If
End With
 
Back
Top