Syntax to set Startup Properties from code

  • Thread starter Thread starter Jim Evans
  • Start date Start date
J

Jim Evans

Can someone please show me the syntax to set the Startup Properties of a
database in VBA code?

I want to write a function to set the Startup Properties just before I make
a .mde file from the .mdb I am working on.

Using Help, I have found the list of Startup properties but I am not able to
get the full syntax correct.
 
Jim,
Thanks. This is the info I need. I have the list of properties. Got it in
vba editor Help.
 
Jim said:
Can someone please show me the syntax to set the Startup Properties of a
database in VBA code?

I want to write a function to set the Startup Properties just before I make
a .mde file from the .mdb I am working on.

Using Help, I have found the list of Startup properties but I am not able to
get the full syntax correct.


Dim db As Database
Set db = CurrentDb()

db.Properties!AppTitle = "some text"
. . .

Set db = Nothing

BUT, the property must already exist before that will work.
The easiest way to precreate the properties you want to set
is to use the Tools - Startup menu item to set them to
whatever. Then your code can set them as needed. If you
have a good reason that I can't see for not presetting the
properties, then you will need to use more code (using
CreateProperty) to create the properties.

For details, see the VBA Help topics
* Set Startup Properties from Visual Basic
* CreateProperty Method
 
Back
Top