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:\BE\MGP\Survey\Survey.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:\BE\MGB\Survey\Survey.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 ?
Dim FrontDB As DAO.Database, BackDB As DAO.Database, Qry As QueryDef
Set FrontDB = CurrentDb
Set BackDB = OpenDatabase("C:\BE\MGP\Survey\Survey.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:\BE\MGB\Survey\Survey.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 ?