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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding record to subform

Status
Not open for further replies.

awelch

Technical User
Apr 24, 2002
85
US
I am trying to update/insert a new record into a sub-form based on new information from the main form. Each change needs to create a new row in the subform section of the form.

here is the code for my refresh button that should insert the record.
Code:
Private Sub cmdRefresh_Click()

   DoCmd.DoMenuItem acFormBar, acRecordsMenu, acAddRecord, , AcMenuVer70

Exit_cmdRefresh_Click:
   Exit Sub
Err_cmdRefresh_Click:
   MsgBox Err.Description
   Resume Exit_cmdRefresh_Click

Exit Sub

Thanks for any assistance.

awelch [sadeyes]
 
Might want to try making the subform the active control before adding the record:

Me![SubFormName].Setfocus
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acAddRecord, , AcMenuVer70

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top