MDB contains forms?

ezfriend

Registered User.
Local time
Today, 03:55
Joined
Nov 24, 2006
Messages
242
Hi All,

How can I programmatically detect if a mdb file contains forms?

I know the easy way just like most people (open & look), but for this purpose, it will take half of my life time to go through all of these dbs.

Any advice is greatly appreciate.

-ezfriend
 
Something like this: (Aircode!)

Code:
CurrentProject.AllForms.Count
 
Not familiar with that syntax. I am assuming that you didn't intend to manually open each database, but rather would write something in one database and have it find things for you. For older databases that aren't necessarily open at the time, the only way to do this that I know of is, in your program,

Use the FoundFiles collection to find all .MDB files on the disk.

For each file you find, open the database with a database variable.

Step through the database.Documents collection.

For each document, check its type to see if it is a form. If so, count it and/or store whatever you need to store.

Remember to close the database when you are done with database-variable.Close

You can find Access help on collections and their traversal. You want to look at the Documents collection in particular.
 
Thank you The Doc Man, I'll take that approach.

-ezfriend
 

Users who are viewing this thread

Back
Top Bottom