Exporting all queries from one Db to another

  • Thread starter Thread starter keith_ab
  • Start date Start date
K

keith_ab

Guest
Hi,

Does anyone know what code is required to export or transfer all queries from one access database to another.

I can copy one query at a time using docmd.copyobject, but I have to know all the names. I want to do an all copy without needing to know the names.

I suspect it may have something to do with using querydefs, but how.

thanks

Keith
 
If you only need to do this once, the easiest thing to do is to open the target database and do an import. Import allows you to select multiple objects. Export only exports one object at a time - that being the selected object.

You can do a bulk export (or import) from code by looping through the querydef collection and using the TransferDatabase Method for each one.
 

Users who are viewing this thread

Back
Top Bottom