• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1287
  • Last Modified:

Compile Error: Label not defined

Trying to compile....but getting Error Message:
Compile Error: Label not defined

Here's the code:


----------------------------------------
Private Sub Drive1_Change()
On Error GoTo ErrDNA
Dir1.Path = Drive1.Drive
End Sub
ErrDNA:  MsgBox "Drive not available"
----------------------------------------


I've been writing in VB for a while and never came across this, looks good to me, n e 1?
0
PME_Inc
Asked:
PME_Inc
2 Solutions
 
Patrick MatthewsCommented:
Private Sub Drive1_Change()
On Error GoTo ErrDNA
Dir1.Path = Drive1.Drive
Exit Sub

ErrDNA:  MsgBox "Drive not available"

End Sub
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
this will work better:

Private Sub Drive1_Change()

On Error GoTo ErrDNA
  Dir1.Path = Drive1.Drive
Exit Sub
 
 ErrDNA:  MsgBox "Drive not available"

End Sub
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
{A very wild guess}
Move the MsgBox "Drive Not available" to the line below ErrDNA:
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now