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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label Not Defined ??? 1

Status
Not open for further replies.

Ryon

Technical User
Nov 1, 2002
64
US
Why am I getting "Label Not Defined"???
I've been staring at this for an hour!!! help please


Private Sub LNEW_Click()
On Error GoTo Err_LNEW_Click
Dim intaswer As VbMsgBoxResult

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

intaswer = MsgBox("DO YOU WANT TO OPEN A NEW TICKET?", vbYesNo + vbQuestion, "NEW TICKET")
If intaswer = vbYes Then
Forms!MAIN!FRM_SUB.SourceObject = "FRM_TICKETS"
Forms!MAIN!FRM_SUB!Combo15.SetFocus
Forms!MAIN!FRM_SUB.Requery
Forms!MAIN!FRM_SUB!Combo15.SetFocus
Else
If intaswer = vbNo Then
DoCmd.CancelEvent
End If
End If
exit_LNEW_Click:
End Sub

Err_LNEW_Click:
MsgBox Err.Description
Resume exit_LNEW_Click
End Sub
 
Which line in the above code gives the error? That may help us see the problem.

ChaZ
 
It looks like its in the error handling, this is a label being used as a button. I have 4 that work fine and 6 that give me the error.

On Error GoTo Err_LNEW_Click
 
You have an End Sub within your exit thingie, replace that with Exit Sub - it can't find Err_LNEW_Click: within the sub.

Roy-Vidar
 
that did it. thanks for you help. Have a star

Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top