Is this Command wrong!

B

Bob

Should the Err_Command336 be Err_Command17 ???
Thanks for your help....Bob

Private Sub Command17_Click()
On Error GoTo Err_Command336_Click

Dim stDocName As String
If Me.Dirty Then Me.Dirty = False
stDocName = "rptCb7"
DoCmd.OpenReport stDocName, acPreview

Exit_Command336_Click:
Exit Sub

Err_Command336_Click:
MsgBox Err.Description
Resume Exit_Command336_Click

End Sub
 
A

Allen Browne

It's fine.

It just need to be a unique label in the procedure, so you can use:
On Error GoTo BobsError
...
BobsError:
MsgBox ...

Long ago, in the Access 1 and 2 days, the label had to be unique across the
procedures, but that has not been an issue for the last 12 years.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top