Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2004
    Posts
    77

    Unanswered: How do I determine if file is available?

    I’ve posted a similar question but…

    What I’m looking for is a way to see if a file is available and if so, run a macro; otherwise, if not available, display a message stating such.

    I want to click a button on a form that will run some routine to see if “z:\database\sidewalks.mdb” is available. If yes, then run a macro called “macTransfer”; if not available, display a message “Network file is not available”.

    Thanks,
    SKK

  2. #2
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41

    Re: How do I determine if file is available?

    This might be a cheesy solution, but could you check for the .ldb file? If it's there, the database is likely in use.

    There are issues on occasion that would result in the .ldb file remaining even after all users are out...

  3. #3
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41

    Re: How do I determine if file is available?

    Whoops -- looks like this would not work if the database was opened exclusively:

    http://support.microsoft.com/default...b;EN-US;289580

  4. #4
    Join Date
    Jan 2004
    Posts
    77
    I think I may have found my answer - Dir() function.

    However, thank you very much for your help. These forums are fantastic.

    Thanks again,
    SKK

  5. #5
    Join Date
    Jan 2004
    Location
    Vancouver, WA
    Posts
    41

  6. #6
    Join Date
    Jan 2004
    Location
    Poland
    Posts
    3

    Lightbulb Re: How do I determine if file is available?

    I want to click a button on a form that will run some routine to see if “z:\database\sidewalks.mdb” is available.

    From:
    http://www.access.vis.pl/af08_fms.htm

    Function If_FileExists(file_ As String) As Boolean
    WizHook.Key = 51488399 'jeœli funkcje zosta³y
    If_FileExists = WizHook.FileExists(file_)
    End Function

    Sub test()
    If If_FileExists("z:\database\sidewalks.mdb")
    MsgBox "File 'z:\database\sidewalks.mdb' exists!"
    Else
    MsgBox "File 'z:\database\sidewalks.mdb' doesn't exists!"
    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
  •