Results 1 to 3 of 3

Thread: find file

  1. #1
    Join Date
    Aug 2004
    Posts
    178

    Unanswered: find file

    i have a from to create by backups in the onopen event

    what i want to do is find out if the file is there if it is i dont want to do the data again.

    the file i am looking for is

    strFileName = "T:\backup\Backup" & Format(datefinsh, "yyyymmdd") & ".CSV"

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You could use a filesystemobject and call it's FileExists method...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    And if you don't want to involve the filesystemobject you could use this simple little function:

    Code:
    Public Function DoesFileExist(PathStrg As String) As Boolean
          Dim a$
          On Error Resume Next
          a$ = Dir(PathStrg, 14)
          If a$ <>  And Err =0 Then DoesFileExist = True
    End Function
    USAGE:
    Code:
    Dim strFileName As String
    strFileName = "T:\backup\Backup" & Format(datefinsh, "yyyymmdd") & ".CSV"
    If DoesFileExsist(strFileName) = True Then
       MsgBox"Yup...It's There!"
    Else
       MsgBox"Nope...It's Not There!"
    End If
    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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