import Access forms programmatically and automatically??

  • Thread starter Thread starter Me
  • Start date Start date
M

Me

Greetings Acceser's....

I want to automate the import process of 200 MDB databases into one
Access 2000 MDB. some of them are access 97 and some 2000. How to loop
through importing tables and queries I know, but how do I do this to
forms, macros, reports and modules?
basically I need to know how to access the list of names of all forms
in a specific mdb file, without it being the one currently running.
(then I can just use the DoCmd.TransferDatabase command with the form
name)
I cannot use CurrentProject.AllForms because as I understand it shows
me the forms list of the currently running database. I want to import
from closed databases.

thanks for reading

hh.
 
Check help for Containers. Those list all the objects. You can open the DB,
and check the containers inside it. CopyObject ought to bring over the
objects you find.

I can't imagine doing what you describe without it resulting in an unusable
mess. For example, I wonder how many switchboards you will end up with, even
if you do not run into naming conflicts.

In any case, best of luck with your project and efforts. I'd be interested
if you'd post a followup here to let us know how it worked, even if no
additional questions arise.

Larry Linson
Microsoft Access MVP
 
It is indeed a mess. eventually I sorted out the code to import all
the objects, there was a complete article on support.micrsoft.com on
how to do it.

http://support.microsoft.com/default.aspx?scid=kb;en-us;298176
http://support.microsoft.com/default.aspx?kbid=298174

I only added some error checking and migration logging routines, to
help with the mess.
what I plan is, to use logging statements througout the process so
that at the weary end of it, one of the results will be a table
describing all the succesfully imported MDB files and their child
objects, type and name.

the new single MDB file will present this information in menus for
users, who will now have a single giant MDB file instead of hundreds
scattered all over the network, and will have to select which former
"MDB" project they want to work on, which form or report etc. of
course they could also hunt through the traditional access repository
list of objects but there will be hundreds of forms, reports etc. so
the menus will make it easier, since they will retain the former MDB
name source of the objects, and most of the users remember it.

duplicate names or other problems halt the import.

the only other way to do this that I can thing of, is to manually
comparing all the mdb's and importing them one by one. The advantage
here is that you can tell whether there is duplicate functionality on
several databases (even with different names) and import only one of
them.


hh.
 
Back
Top