Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set options & properties in new database

Status
Not open for further replies.

kndavies

Technical User
Jan 23, 2003
30
GB
Hi,
I have an application that allows the user to create several other applications each with a subset of the data from the first. I have succeeded in setting the necessary start up options and properties for each of these but only by having an AutoExec macro that calls the code. Thus only on the second opening does the database window look the way I want it to look to the user.

Any ideas how to make the application look like an application on first opening gratefully received.

Thanks,
Ken

the AutoExec macro calls code that first sets a reference to the DAO library then...

Sub StartProperties()
Dim db As DAO.Database
Dim prp As DAO.Property

On Error Resume Next
Set db = CurrentDb

'set application title
db.Properties("AppTitle") = "Ophthalmologist Profiler"
Set prp = db.CreateProperty("Apptitle", dbText, "Ophthalmologist Profiler")
db.Properties.Append prp
Application.RefreshTitleBar

'set start up form
db.Properties("StartUpForm") = "Switchboard"
Set prp = db.CreateProperty("StartUpForm", dbText, "Switchboard")
db.Properties.Append prp

'hide database window
db.Properties("StartUpShowDBWindow") = False
Set prp = db.CreateProperty("StartUpshowdbwindow", dbBoolean, False)
db.Properties.Append prp

db.Properties("StartUpMenuBar") = False
Set prp = db.CreateProperty("StartUpmenubar", dbBoolean, False)
db.Properties.Append prp

db.Properties("AllowFullMenus") = False
Set prp = db.CreateProperty("AllowFullMenus", dbBoolean, False)
db.Properties.Append prp

db.Properties("AllowBuiltInToolbars") = False
Set prp = db.CreateProperty("AllowBuiltInToolbars", dbBoolean, False)
db.Properties.Append prp

db.Properties("AllowToolbarChanges") = False
Set prp = db.CreateProperty("AllowToolbarChanges", dbBoolean, False)
db.Properties.Append prp

db.Properties("startupshowstatusbar") = False
Set prp = db.CreateProperty("startupshowstatusbar", dbBoolean, False)
db.Properties.Append prp

Application.SetOption "Auto Compact", True
DoCmd.OpenForm "Switchboard"

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top