command button question

  • Thread starter Slez via AccessMonster.com
  • 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!
 
A

Allen Browne

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
 
S

Slez via AccessMonster.com

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.
 

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