Results 1 to 2 of 2
  1. #1
    FSCHAMP is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    4

    VBA to check if a database is open

    Hello,

    I have a DB "A" where I make a copy of an other DB "B" with the next VBA part:

    HDatum = Int(Now())
    dag = Format(HDatum, "ddd", vbMonday, vbUseSystem)

    '***************************************
    '*** Stel doel- en bronbestand in ***
    '***************************************
    doelbestand = "S:\Common\gino\backupDatabases\Data of dbStocktanks_" & dag & ".mdb"
    bronbestand = "S:\Common\Lean-DPS general folder\STocktank analysis\Data of dbStocktanks.mdb"

    '****************
    '*** Kopiëer ***
    '****************
    FileCopy bronbestand, doelbestand



    But I got an error when the DB "B" is open. How can this be solved?

    Regards,

    FSCHAMP.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Database wont open
    By sarah54 in forum Access
    Replies: 22
    Last Post: 12-08-2010, 08:38 AM
  2. How do I open another database using VBA?
    By avarusbrightfyre in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 07:18 PM
  3. cannot open any database
    By Factor in forum Access
    Replies: 3
    Last Post: 03-24-2010, 12:51 PM
  4. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  5. Replies: 1
    Last Post: 02-12-2010, 01:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums