I have code that runs a number of queries resulting in a final table that will be appended to a linked business database. I want to give the user one final chance to say no so I am trying to intercept the NO reply from the append query message of "You are about to append nnn records".
Following is my current code.
Private Sub Upload_Click()
Dim Response
Response = MsgBox("Are you sure you want to upload", vbYesNo)
If Response = vbYes Then
Me!Text25 = "Uploading to Shop Floor"
DoCmd.SetWarnings True
DoCmd.OpenQuery "SF-0080-Upload Material"
MsgBox "Upload complete", vbOK
End If
If I press NO then I get a Run-time error '2501', The OpenQuery action was cancelled. What I want to do is trap this and proceed to my normal cleanup.
Any help is appreciated.
Thanks