Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error

Status
Not open for further replies.

MelF

Technical User
Oct 26, 2000
81
US
I have the following code in a command button:

Private Sub PackingSlipButton_Click()
On Error GoTo Err_PackingSlipButton_Click

Dim stDocName As String

stDocName = "EmployeePackingSlip"
DoCmd.OpenReport stDocName, acPreview

Exit_PackingSlipButton_Click:
Exit Sub

Err_PackingSlipButton_Click:
MsgBox Err.Description
Resume Exit_Preview_Report_Click

End Sub

When I click the button I get the error, "Compile Error: Label Not Defined". Everything appears fine to me, and is referenceing correct objects. Anyone know what might be going on?
 
In the following part of your code there is mistake.


Exit_PackingSlipButton_Click:
Exit Sub

Err_PackingSlipButton_Click:
MsgBox Err.Description
--> Resume Exit_Preview_Report_Click

it should be: Exit_PackingSlipButton_Click

Later,

Wilson
 
Thank you so much for your catch!!! Problem solved!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top