Hello,
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
and
DoCmd.GoToRecord sfContactRoles1
DoCmd.GoToRecord , , acNewRec
and
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?
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
and
DoCmd.GoToRecord sfContactRoles1
DoCmd.GoToRecord , , acNewRec
and
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?