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
Else
End If
End If
End Sub
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.