On a form I have a command button and when the user clicks the button I want the record displayed on the form to be copied to a separate table via a update query which I have already designed. The fields are the same in both tables.
Also on the form is a checkbox. If the checkbox is true then I want a message box to appear allowing the user to back out of the routine OR overwrite the existing record. The key field is "Invoice #" in both tables or "txtInvoice#" on the form.
Here is my code but its not working.
Private Sub cmdCopyRecToRevTbl_Click()
If Me.chkbxRecCopiedToRevTbl = True Then
If MsgBox("You have already copied this record to the Revenue table. Click No to abort. Click Yes to overwrite the existing record.", vbYesNo + vbQuestion + vbDefaultButton2) = vbYes Then
DoCmd.OpenQuery "updqryCopyInvToRevTable", acViewNormal, acAdd