Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New Record Button for subform 1

Status
Not open for further replies.

knuckelhead

Technical User
Aug 8, 2002
228
0
0
US
I have a main form which has a button, noted below, that creates a new blank screen for Main form top section input. it works fine.

Private Sub cmd_ADD_Junction_SHEET_Click()
DoCmd.GoToRecord , , acNewRec
End Sub

But now, i want to ADD a button on the Tab page to create a new record in the SUBFORM.

I am confused because this subform Add button would technically be on the Main form, even though the button resides on the Tab page. right? So how do i get this newer button to add just to the subform. and do nothing to the main form data?
 
Try:
[tt]DoCmd.GoToControl "SubformControlName"
DoCmd.GoToRecord , , acNewRec[/tt]
 
You are outstanding as usual. it woiks moe.
It works better than I desired. I get a blank subform record at the top. I make my entry. I then hit my Save button (i realize that a save button is not necessary).
I then see my new record at the top (i have it descending date order) AS WELL AS my history subform records. that is unbelievable.

Private Sub cmd_ADDAppt_Click()
DoCmd.GoToControl "sfrmJobDetail"
DoCmd.GoToRecord , , acNewRec
End Sub

Knucklehead
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top