Setting Startup Form with vba

DNewman

Registered User.
Local time
Today, 11:20
Joined
Oct 12, 2012
Messages
60
Hi,
Access 2010, Windows 7
I presume the specification of the start-up form is a property of a database. How can I use vba to set this property?
 
CurrentDb.Properties("StartUpForm")="myForm"

Though I'm curious why you would want to dynamically change this.
 
You could also use an AutoExec macro, either to open the form directly or to run code that does things including open that form. Comes in handy if there's anything you need done BEFORE the first form opens, such as check version numbers and update the front end if necessary.
 
Many thanks to you both - I had already thought to use 'auto exec' when I read your answer Frothingslosh(!)
TJPoorman, you asked Why? - my client wants to be able to create individual customised databases from within the basic database - so I was setting properties for a new database. What I DID discover, that I had not realised, was that some database properties don't automatically exist so can't be set for a new database until they have been added to the properties collection.
There is always something new to learn in life!!
 
CurrentDb.Properties("StartUpForm")="myForm"

Though I'm curious why you would want to dynamically change this.

thanks for this, I have used this in my Xmas quiz i set will be available automatically on the date 01/12/2020 no need for me to change opening form, as if leave it on main form people can try before hand he-he

(well unless you change your time and date but as we work in a strict office environment then no worry of that )
 

Attachments

my client wants to be able to create individual customised databases from within the basic database
Bad move. This will be a nightmare to manage. It is better to use custom security to manage who has access to what. This will allow you to maintain a single version of the FE and replace it for everyone when it is updated.
 
Bad move. This will be a nightmare to manage. It is better to use custom security to manage who has access to what. This will allow you to maintain a single version of the FE and replace it for everyone when it is updated.
@Pat Hartman Just FYI, that was a 5-year old post, in case you missed it. :)
 

Users who are viewing this thread

Back
Top Bottom