Home Page
Policies
Policies
About
Tips And Tricks
Helpful Links
e-mail me

Picture of building from outside Tips And Tricks

I seem to run into things from time to time that I want to share with the world, usually things that I had to find out the hard way. Sometimes it will just be something that I had to dig for, and want to make more readily accessible. This page is intended to make life a little easier for other programmers. If it meets your need, then that's what it's here for.



Enumerate MS Access Project Properties

We had a problem with our batch files that publish new versions. I wanted to be able to turn off the startup form while the batch file ran. I needed to know what property to set to do that. Well, the easy way to find out the exact property name was to enumerate the properties of the project using the CurrentProject object. I searched and looked, but I didn't easily find an example of this on the internet. I did find a mention of the ability to enumerate project properties on a Microsoft Access 2003 web site . . . but no example was listed there. Here's what I came up with:
Dim Prps As AccessObjectProperties
Dim Prp As AccessObjectProperty

'Enumerate currentproject properties -BWM 06-23-08
Set Prps = CurrentProject.Properties
For Each Prp In Prps
 Debug.Print Prp.Name; ": "; Prp.Value
Next
Simple, right? But if you don't have an example, then you have to fumble through, get a few type mismatch errors, figure out how to use a "For Each" instead of a "For Next" with the properties count, etc. Who wants to do all that? Here it is, spelled out to start with.


If you found this information to be useful, and would like to donate via PayPal to help offset the cost of maintaining this web site, use the following button:



|Home Page| |Custom Software| |Policies| |About| |Tips And Tricks| |Helpful Links|