Records goto next command

T

thecuzin

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]")
 
A

Allen Browne

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
 

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