Results 1 to 2 of 2

Thread: On Error Statement

  1. #1

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237

    On Error Statement

    Hi all I have an on error statemet that keeps on comming back and biting me on the a$$.
    I'll show the code then I'll explain



    Public Sub ReadIn
    Dim test As Integer
    test = 1
    Filename = "\\Primary_domain\Phone Billing Software\Accounts 2.4\T4A.dat"
    Reader = 1
    ReDim Preserve LoadedAcc(Reader) As Account
    On Error GoTo Messed
    Open Filename For Random As #2 Len = Len(LoadedAcc(test))

    Do
    ReDim Preserve LoadedAcc(Reader) As Account
    Get #2, Reader, LoadedAcc(Reader)
    Reader = Reader + 1
    Loop Until Reader = Len(LoadedAcc(test))
    UpdateDisplay

    Messed:
    Oker = MsgBox("File Can Not Be Opened, Check to See if File Exists, Then Try Again.", ConBtns2, "GWN Accounts")

    End Sub
    Just below the Do statement I have a call to "UpdateDisplay"

    everything works fine, the code loads the LoadedAcc just fine.
    It then goes to my UpdateDisplay but when it comes back it goes directly to my On Error Statement "Messed"

    I cant seem to get it to miss that

    any Ideas

  2. #2

    Thread Starter
    Addicted Member Booda's Avatar
    Join Date
    Aug 2001
    Location
    B.C, Canada
    Posts
    237

    Re: On Error Statement

    Originally posted by Booda
    Hi all I have an on error statemet that keeps on comming back and biting me on the a$$.
    I'll show the code then I'll explain





    Just below the Do statement I have a call to "UpdateDisplay"

    everything works fine, the code loads the LoadedAcc just fine.
    It then goes to my UpdateDisplay but when it comes back it goes directly to my On Error Statement "Messed"

    I cant seem to get it to miss that

    any Ideas
    Never Mind
    I just put a Exit Sub just below the UpdateDisplay
    See ya

    Booda

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