Results 1 to 4 of 4

Thread: Error trapping when changing drive

  1. #1

    Thread Starter
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322

    Unhappy Error trapping when changing drive

    Hi all,

    I have a form with a dirlistbox and a drivelistbox.
    When I change my drive to a: and there's no disk inserted it generates an arro6 68. But it isn't trapped. Can someone help me please?

    VB Code:
    1. Private Sub Drive1_Change()
    2.  
    3. On Error GoTo HSB_ErrorMsg
    4.  
    5. Dir1.Path = Drive1.Drive
    6. Exit Sub
    7.  
    8. HSB_ErrorMsg:
    9.     Screen.MousePointer = vbDefault
    10.     MsgBox "An error occured during this action " & vbCrLf & Err.Number & " : " & Err.Description, vbExclamation, "HSB Error: HSBMng 1002"
    11.    
    12. End Sub

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Works on NT4

    What OS are you using?
    Mark
    -------------------

  3. #3

    Thread Starter
    Hyperactive Member mvrp350's Avatar
    Join Date
    Feb 2001
    Location
    Best, the Netherlands
    Posts
    322
    W2K, VB 6.0 sp5.

  4. #4
    Grate_Dev
    Guest

    Drive, Dir & File box

    Private Sub Drive1_Change()
    On Error GoTo HSB_ErrorMsg
    Dir1.Path = Drive1.Drive
    Exit Sub
    HSB_ErrorMsg:
    If Err.Number = 68 Then
    MsgBox Err.Description & vbCrLf & "Please insert disk into the drive."
    Drive1.Drive = CurDir
    Else
    MsgBox "An error occured during this action " & vbCrLf & Err.Number & " : " & Err.Description, vbExclamation, "HSB Error: HSBMng 1002"
    End If
    End Sub

    Private Sub Dir1_Change()
    On Error Resume Next
    File1.Path = Dir1.Path
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width