By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

Programatically Set Startup Form on a newly created Database

P: 1

Within my Access program I create a new database using VBA. After the new database is created, I would like to set a form in it to appear on startup.

I have tried using CurrentDb.Properties("StartupForm")
but am not sure what I need to replace CurrentDB with in order to target the newly created DB.


Is their any way to export my "startup properties" of the current database to the newly created database?

thank you
Jan 10 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 31,487
How does your VBA do that? Does it use Application Automation? Does it close the currently open database first (If so, how is the code still running)?

To get a list of the available properties for a database I used the Immediate Pane of the VBA IDE and ran this code :
Expand|Select|Wrap|Line Numbers
  1. Set db = CurrentDb : For Each prp in db.Properties : ?prp.Name : Next prp
I expect the one you need is StartUpForm.

Also, you can find some working code I use for working with database properties in Database Properties. It may be of some help.
Jan 11 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.