compile error: label not defined

G

Guest

I have a compile error I can't understand. I placed >< around the line that
the debugger highlights. Any help is greatly appreciated - THANKS!

Private Sub Country_Region_DblClick(Cancel As Integer)
On Error GoTo Err_Country_Region_DblClick
Dim lngCity As Long

If IsNull(Me![Country_Region]) Then
Me![Country_Region].Text = ""
Else
lngCountry_Region = Me![Country_Region]
Me![Country_Region] = Null
End If
DoCmd.OpenForm "frmCountriesLanguages", , , , , acDialog, "GotoNew"
Me![Country_Region].Requery
If lngCountry_Region <> 0 Then Me![Country_Region] = lngCountry_Region

Exit_City_DblClick:
Exit Sub

Err_City_DblClick:
MsgBox Err.Description
Resume Exit_Country_Region_DblClick<
End Sub
 
G

Guest

Hi, John.
I have a compile error

Replace this line:

Resume Exit_Country_Region_DblClick

.. . . with this one:

Resume Exit_City_DblClick

So that I never have to make changes to labels in my error handling code, I
use a generic error handler for procedures. For example:

Private Sub OpenOEBtn_Click()

On Error GoTo ErrHandler

' Code goes here.

CleanUp:

' Cleanup code goes here.

Exit Sub

ErrHandler:

MsgBox "Error in OpenOEBtn_Click( ) in " & Me.Name & " form." & _
vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description, _
vbExclamation + vbOKOnly, "Error!"
Err.Clear
GoTo CleanUp

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.


JohnLute said:
I have a compile error I can't understand. I placed >< around the line that
the debugger highlights. Any help is greatly appreciated - THANKS!

Private Sub Country_Region_DblClick(Cancel As Integer)
On Error GoTo Err_Country_Region_DblClick
Dim lngCity As Long

If IsNull(Me![Country_Region]) Then
Me![Country_Region].Text = ""
Else
lngCountry_Region = Me![Country_Region]
Me![Country_Region] = Null
End If
DoCmd.OpenForm "frmCountriesLanguages", , , , , acDialog, "GotoNew"
Me![Country_Region].Requery
If lngCountry_Region <> 0 Then Me![Country_Region] = lngCountry_Region

Exit_City_DblClick:
Exit Sub

Err_City_DblClick:
MsgBox Err.Description
Resume Exit_Country_Region_DblClick<
End Sub
 
G

Guest

Thanks! Good grief - I can't believe I didn't see that!

--
www.Marzetti.com


'69 Camaro said:
Hi, John.
I have a compile error

Replace this line:

Resume Exit_Country_Region_DblClick

. . . with this one:

Resume Exit_City_DblClick

So that I never have to make changes to labels in my error handling code, I
use a generic error handler for procedures. For example:

Private Sub OpenOEBtn_Click()

On Error GoTo ErrHandler

' Code goes here.

CleanUp:

' Cleanup code goes here.

Exit Sub

ErrHandler:

MsgBox "Error in OpenOEBtn_Click( ) in " & Me.Name & " form." & _
vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description, _
vbExclamation + vbOKOnly, "Error!"
Err.Clear
GoTo CleanUp

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.


JohnLute said:
I have a compile error I can't understand. I placed >< around the line that
the debugger highlights. Any help is greatly appreciated - THANKS!

Private Sub Country_Region_DblClick(Cancel As Integer)
On Error GoTo Err_Country_Region_DblClick
Dim lngCity As Long

If IsNull(Me![Country_Region]) Then
Me![Country_Region].Text = ""
Else
lngCountry_Region = Me![Country_Region]
Me![Country_Region] = Null
End If
DoCmd.OpenForm "frmCountriesLanguages", , , , , acDialog, "GotoNew"
Me![Country_Region].Requery
If lngCountry_Region <> 0 Then Me![Country_Region] = lngCountry_Region

Exit_City_DblClick:
Exit Sub

Err_City_DblClick:
MsgBox Err.Description
Resume Exit_Country_Region_DblClick<
End Sub
 
6

'69 Camaro

You're welcome! Always remember that two sets of eyes are better than one!

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


JohnLute said:
Thanks! Good grief - I can't believe I didn't see that!

--
www.Marzetti.com


'69 Camaro said:
Hi, John.
I have a compile error

Replace this line:

Resume Exit_Country_Region_DblClick

. . . with this one:

Resume Exit_City_DblClick

So that I never have to make changes to labels in my error handling code,
I
use a generic error handler for procedures. For example:

Private Sub OpenOEBtn_Click()

On Error GoTo ErrHandler

' Code goes here.

CleanUp:

' Cleanup code goes here.

Exit Sub

ErrHandler:

MsgBox "Error in OpenOEBtn_Click( ) in " & Me.Name & " form." & _
vbCrLf & vbCrLf & _
"Error #" & Err.Number & vbCrLf & Err.Description, _
vbExclamation + vbOKOnly, "Error!"
Err.Clear
GoTo CleanUp

End Sub

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.


JohnLute said:
I have a compile error I can't understand. I placed >< around the line
that
the debugger highlights. Any help is greatly appreciated - THANKS!

Private Sub Country_Region_DblClick(Cancel As Integer)
On Error GoTo Err_Country_Region_DblClick
Dim lngCity As Long

If IsNull(Me![Country_Region]) Then
Me![Country_Region].Text = ""
Else
lngCountry_Region = Me![Country_Region]
Me![Country_Region] = Null
End If
DoCmd.OpenForm "frmCountriesLanguages", , , , , acDialog, "GotoNew"
Me![Country_Region].Requery
If lngCountry_Region <> 0 Then Me![Country_Region] =
lngCountry_Region

Exit_City_DblClick:
Exit Sub

Err_City_DblClick:
MsgBox Err.Description
Resume Exit_Country_Region_DblClick<
End Sub
 

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

Top