Need Error Number to trap

  • Thread starter Thread starter Bonnie
  • Start date Start date
B

Bonnie

Hello everyone! Using A02 on XP. I needed to trap the
error about cannot add record as it would create duplicate
value...; trap 3022. It identified itself. Now I'm
getting: DoMenuItem was cancelled. What error number do I
trap? Is there a list somewhere?

Thanks in advance for any help or advice!
 
In your error handler, just add the line
msgbox err.number
that will give you the number so you can trap it.
 
**********************************************************
Try creating a blank, (empty) database, then do an import.

**********************************************************
 
Huh??? Okay, I created a blank DB, and imported the table
and query and form, spent 20 minutes disconnecting all the
sub-sub forms and code. I'm still getting the same error.
What now? Here's what I have:

Private Sub Command79_Click()
On Error GoTo Err_Command79_Click


DoCmd.GoToRecord , "Data Entry Form", acNewRec

Exit_Command79_Click:
Exit Sub
Err_Command79_Click:
Select Case Err.Number
Case 3022
MsgBox "A record containing the Plan Number and
Check Number you have keyed in already exist, please check
your data. Close the form and reopen to enter additional
records."
Resume Next
Case Else
MsgBox Err.Description
Resume Exit_Command79_Click
End Select

End Sub

Any help or advice would be appreciated! Thx!
 
Back
Top