Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    strange behaviour (Access 2000)

    I want to export all queries as follows
    Dim FrontDB As DAO.Database, BackDB As DAO.Database, Qry As QueryDef
    Set FrontDB = CurrentDb
    Set BackDB = OpenDatabase("C:BEMGPSurveySurvey.mdb")
    For Each Qry In FrontDB.QueryDefs
    DoCmd.TransferDatabase acExport, "Microsoft Access", BackDB.Name, acQuery, Qry.Name, Qry.Name
    Next
    BackDB.Close
    FrontDB.Close


    However I get the error that the path is not found. However the path is true,I do not know why this error occurs.
    For example the fllowing line is OK :
    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGBSurveySurvey.mdb", acModule, "mdlupsize", "mdlupsize"

    Why it is Ok in the second example but not in the first I do not know. It is very strange. Do you have any explanation ?

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

    Re: strange behaviour (Access 2000)

    There is no point in using OpenDatabase. Simply specify the path and filename as in your working example.

    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGPSurveySurvey.mdb", acQuery, Qry.Name, Qry.Name

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: strange behaviour (Access 2000)

    Thank you for the good advice !

Posting Permissions

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