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