Access Access 2007 New Record Command for subform

Jun 6, 2012
Reaction score

I have a forms with two subforms, "sfContactRoles1" and "Residential Contacts" (pardon the break in naming convention). They are linked through a non-visible text box on the main form. sfContactRoles1 is in datasheet view. I would like to have a command button that opens a new record in the datasheet, but will have to place the button in the Residential Contacts subform.

I tried to use the code

DoCmd.GoToRecord sfContactRoles1, , acNewRec


DoCmd.GoToRecord sfContactRoles1
DoCmd.GoToRecord , , acNewRec


DoCmd.GoToRecord "sfContactRoles1"
DoCmd.GoToRecord , , acNewRec
(this code returns "Error 13: Type Mismatch")

and finally

DoCmd.GoToRecord [sfContactRoles1].[Form]![pkContactID]
DoCmd.GoToRecord , , acNewRec

And now I'm out of ideas. Does anyone have some advice?

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

Similar Threads