Label Not Defined??

ohphunk

A Questionnaire
Local time
Today, 13:33
Joined
Jun 6, 2007
Messages
33
I compiled my module, but an error came out,

Select Case Err.Number
Case 9999 ' Whatever number you anticipate.
Resume Next ' Use this to just ignore the line.
Case 999
Resume Exit_SomeName ' Use this to give up on the proc.
Case Else ' Any unexpected error.
Call LogError(Err.Number, Err.Description, "SomeName()")
Resume Exit_SomeName
End Select

And the error came out, Label Not Defined.
I've checked with "help", and it stated that

"The label must be within the procedure that contains the reference. Line labels are visible only in their own procedures"

Is there any missing references in the library I should checked??

Thanks!:D
 
Hi

"Resume Exit_SomeName" basically means continue running code from the point in my procedure that I've labelled "Exit_SomeName" i.e. there needs to be such a label in your procedure. A label is just a way of marking a specific point in your procedure. Typically (note the colon)...
Code:
Exit_SomeName:
	'put my exit code here..
	'perhaps put an explanation message 

	EXIT SUB ' exit the procedure

A label is something you define so you could just as easily have had (obviously usng a different label reference):
Code:
myErrorExitCode:
	'put my exit code here..
	'perhaps put an explanation message 

	EXIT SUB ' exit the procedure

If you create a button on a form to, say. Run a report, the wizard will automatically provide some basic error handling code with an example of Resume label (Access help doesn't provide such an example)

Hth
Stopher
 

Users who are viewing this thread

Back
Top Bottom