command button question

  • Thread starter Thread starter Slez via AccessMonster.com
  • Start date Start date
S

Slez via AccessMonster.com

I'm quite certain this this is not difficult, but I don't really know how
write the code to accomplish it.

I'd like to place a command button on a mainform called frmMainScreen, that
when clicked would take you directly to the new record in a subform called
frmPunchItemEntry.

I know there is the NewRecord button at the bottom of the subform, but I'd
like a larger, more visible button at the top of the form.

Any suggestions are appreciated!
 
Set focus to the subform control, then to a control in the subform.
You can then tell Access to go to the new record.

This kind of thing:

With Me.frmPunchItemEntry
.SetFocus
.Form![NameOfSomeControlInTheSubformHere].SetFocus
End With
RunCommand acCmd RecordsGotoNew
 
That worked great!
Thank you!

Allen said:
Set focus to the subform control, then to a control in the subform.
You can then tell Access to go to the new record.

This kind of thing:

With Me.frmPunchItemEntry
.SetFocus
.Form![NameOfSomeControlInTheSubformHere].SetFocus
End With
RunCommand acCmd RecordsGotoNew
I'm quite certain this this is not difficult, but I don't really know how
write the code to accomplish it.
[quoted text clipped - 6 lines]
I know there is the NewRecord button at the bottom of the subform, but I'd
like a larger, more visible button at the top of the form.
 
Back
Top