Zeroanarchy
Technical User
Ok created the following code to run on start up so as it makes all the menus + extra disapear, only problem is I do not know where to put it. lol If I put it in with the startup form none of it will work. Tried making an Autoexec module but of course that is not called on at start up. Can anyone advise me as to where you place code that you want to run before your first form appears. Set by set might help.
Thanks ZeroAnarchy
Private Sub Autoexec()
Dim db As Database
Dim prp As Property
Dim intX As Integer
Set db = CurrentDb
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show System Objects", False
Application.SetOption "Provide Feedback With Sound", False
Application.SetOption "Show Values Limit", 10000
Application.SetOption "Move After Enter", 1
Application.SetOption "Behavior Entering Field", 0
Application.SetOption "Arrow Key Behavior", 1
Application.SetOption "Show Status Bar", False
Application.SetOption "Default find/replace behavior", 1
DoCmd.OpenForm "Data"
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Filter/Sort", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
DoCmd.ShowToolbar "Macro Design", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo
DoCmd.ShowToolbar "Query Datasheet", acToolbarNo
DoCmd.ShowToolbar "Query Design", acToolbarNo
DoCmd.ShowToolbar "Relationship", acToolbarNo
DoCmd.ShowToolbar "Report Design", acToolbarNo
DoCmd.ShowToolbar "Source Code Control", acToolbarNo
DoCmd.ShowToolbar "Table Datasheet", acToolbarNo
DoCmd.ShowToolbar "Table Design", acToolbarNo
DoCmd.ShowToolbar "Toolbox", acToolbarNo
DoCmd.ShowToolbar "Utility 1", acToolbarNo
DoCmd.ShowToolbar "Utility 2", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
DoCmd.ShowToolbar "Visual Basic", acToolbarNo
Set prp=db.CreateProperty("AllowByPassKey",dbBoolean, False)
Set prp=db.CreateProperty("StartupShowDBWindow",DB_BOOLEAN, False)
Set prp=db.CreateProperty("StartupShowStatusBar", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowBuiltinToolbars", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowFullMenus", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowBreakIntoCode", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowSpecialKeys", DB_BOOLEAN, False)
End Sub
Thanks ZeroAnarchy
Private Sub Autoexec()
Dim db As Database
Dim prp As Property
Dim intX As Integer
Set db = CurrentDb
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show System Objects", False
Application.SetOption "Provide Feedback With Sound", False
Application.SetOption "Show Values Limit", 10000
Application.SetOption "Move After Enter", 1
Application.SetOption "Behavior Entering Field", 0
Application.SetOption "Arrow Key Behavior", 1
Application.SetOption "Show Status Bar", False
Application.SetOption "Default find/replace behavior", 1
DoCmd.OpenForm "Data"
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Filter/Sort", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
DoCmd.ShowToolbar "Macro Design", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo
DoCmd.ShowToolbar "Query Datasheet", acToolbarNo
DoCmd.ShowToolbar "Query Design", acToolbarNo
DoCmd.ShowToolbar "Relationship", acToolbarNo
DoCmd.ShowToolbar "Report Design", acToolbarNo
DoCmd.ShowToolbar "Source Code Control", acToolbarNo
DoCmd.ShowToolbar "Table Datasheet", acToolbarNo
DoCmd.ShowToolbar "Table Design", acToolbarNo
DoCmd.ShowToolbar "Toolbox", acToolbarNo
DoCmd.ShowToolbar "Utility 1", acToolbarNo
DoCmd.ShowToolbar "Utility 2", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
DoCmd.ShowToolbar "Visual Basic", acToolbarNo
Set prp=db.CreateProperty("AllowByPassKey",dbBoolean, False)
Set prp=db.CreateProperty("StartupShowDBWindow",DB_BOOLEAN, False)
Set prp=db.CreateProperty("StartupShowStatusBar", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowBuiltinToolbars", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowFullMenus", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowBreakIntoCode", DB_BOOLEAN, False)
Set prp = db.CreateProperty("AllowSpecialKeys", DB_BOOLEAN, False)
End Sub