I would like to have a commnad button that selects, copies and saves a record from the current form and then open a new form and place the record there. Upon closing the new form I would like the record from the current form to be deleted. I have played around with the following code, but cannot seem to get it to come together. If I exclude "acFormAdd, acDialog" then I can duplicate. But I need this to "pause" the deletion. Since I am a novice programmer, I just can't seem to figure this out on my own.
Thanks!
Private Sub Command61_Click()
'Initialize error handling
On Error GoTo Proc_Error
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.OpenForm "GL_DEL", , , , acFormAdd, acDialog
DoCmd.RunCommand acCmdPasteAppend
DoCmd.RunCommand acCmdDeleteRecord
Proc_Exit:
Exit Sub
Proc_Error:
Select Case Err.Number
Case 2501 'Action Cancelled
Resume Proc_Exit
Case Else
MsgBox Err.Number & vbCrLf & Err.Description, vbOKOnly + vbCritical, "Runtime Error"
End Select
End Sub
Thanks!
Private Sub Command61_Click()
'Initialize error handling
On Error GoTo Proc_Error
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.OpenForm "GL_DEL", , , , acFormAdd, acDialog
DoCmd.RunCommand acCmdPasteAppend
DoCmd.RunCommand acCmdDeleteRecord
Proc_Exit:
Exit Sub
Proc_Error:
Select Case Err.Number
Case 2501 'Action Cancelled
Resume Proc_Exit
Case Else
MsgBox Err.Number & vbCrLf & Err.Description, vbOKOnly + vbCritical, "Runtime Error"
End Select
End Sub