Syntax to set Startup Properties from code

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.
 
J

JimBurke via AccessMonster.com

Here's an example of setting the startup property for the application title:

Dim dbs As Variant

Set dbs = CurrentDb
dbs.Properties("AppTitle") = "My Application Version " & applVersion & "."
& applRelease


Similarly, you can also set options, e.g.

Application.SetOption "Confirm Action Queries", False

Can't help you with the exact names of all the properties. Pretty sure I
found them by doing a web search, or maybe someone else here can list them.
 
J

Jim Evans

Jim,
Thanks. This is the info I need. I have the list of properties. Got it in
vba editor Help.
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top