Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Switched off computer (Access 2000)

    I have the following problem. I have to copy files to other computers with the following code:
    If Dir(Alex) <> "" Then
    Kill Alex ' this is the path to the computer
    End If
    StrDest = Alex
    FileCopy StrSource, StrDest

    The code works fine in case the computer is switched on. However if the computer is not on, i get the message bad file or number. What i want is that when the computer is off, the code to continue sending files to other computers that are on.
    How could i do that ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Switched off computer (Access 2000)

    Add an error handler:

    Sub MyProc()
    On Error GoTo ErrHandler
    ...
    ...
    If Dir(Alex) <> "" Then
    Kill Alex ' this is the path to the computer
    End If
    strDest = Alex
    FileCopy StrSource, strDest

    ContinueHere:
    ...
    ...
    Exit Sub

    ErrHandler:
    If Err = 52 Then
    Resume ContinueHere
    Else
    MsgBox Err.Description, vbExclamation
    End If
    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
  •