My duplicate record button works perfectly when the form is open seperately. When I open the form as a sub form the button no longer functions properly. It creates a new record but it doesn't copy any of the information.
I have tried changing the code but to no avail. See code below.
This is the code that works with the sub form open seperately:
This is what I tried various version of:
Any ideas?
I have tried changing the code but to no avail. See code below.
This is the code that works with the sub form open seperately:
Code:
Private Sub Duplicate_Click()
On Error GoTo Err_Duplicate_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_Duplicate_Click:
Exit Sub
Err_Duplicate_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Click
End Sub
This is what I tried various version of:
Code:
Private Sub Duplicate_Click()
On Error GoTo Err_Duplicate_Click
Me!MainForm.SubForm.DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
Me!MainForm.SubForm.DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
Me!MainForm.SubForm.DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_Duplicate_Click:
Exit Sub
Err_Duplicate_Click:
MsgBox Err.Description
Resume Exit_Duplicate_Click
End Sub
Any ideas?