vb123.com.au
This really tricky question was posed in Issue 12 of our Access Unlimited magazine. There was 3 good answers to this question with the first one being the correct one for this problem. One of the others is featured in the download database.
In A97 how do you create the DB Title property (and others) in a DB that is created in code as part of an application. The DB is empty when initially created and has no properties set and indeed some don't even exist until they are initially set. It is easy enough to create the property in code from within the New DB itself, but the requirement is to create it in the New DB from the first DB immediately after the first database creates the New one. ???
The particular properties are those you see from the System tab in
File|Properties menu.
Any insights into this would be appreciated.
Regards
Peter Hallinan <peter @ 3rdmillennium.com.au>
Answer 1 From Robert . Johanson @ Mims.com.au
To try this answer, copy the code below to a blank module, change the NewDb constant and open the debug window. Now type Call SetSubject into the window.
The other 2 good examples can be found in the answers database
Notes On Answer 2
The
following functions GetProperty_DAO and SetProperty_DAO can be used to
either return or set the respective database properties. Each function
returns a boolean value indicating the success or failure of the process.
The SetProperty_DAO function has an optional parameter of the path and
name of the database to set the property for. If omitted it uses the
current
database.
Note also that they are DAO functions and will require modifications for
an
Access 2000 ADO database.
Simply copy this module into any new project, set those properties in
'SetStartupProperties' and comment out the others, then run the routine
SetStartupProperties.
The sample database is included in the zip file
If you do NOT own "The Toolbox", Click
here to find out how to purchase The Toolbox.
Click
for the next help page or try these other advanced pages
Related Pages On This Site
Compiled Access Databases
Checking a report property for all Microsoft Access Reports
Transaction Queries
Get Good Help Here
If you need help with a database or
Office programming,
our Professionals could be the answer because we have worked on many
similar solutions
Frontpage Conversions
We have converted vb123.com to Expression Web,
contact us if we can help you move to the latest Microsoft web tool.
About The Editor ~ Contact Us
Garry Robinson writes for a number
of popular computer magazines, is now a book author and has worked on
100+ Access databases. He is based in Sydney, Australia