473,387 Members | 1,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Show Menus/Toolbars on Startup

I have set the Startup properties to the following...
All menus, toolbars, etc are turned off plus these are unchecked
Allow Full Menus
Allow Built-in Toolbars
Allow Default Shortcut Menus
Allow Toolbar/Menu Changes
Use Access Special Keys
For admin users...
I would like to run some VB code in my Main startup form (OnOpen) to
show the default menu/toolbars as if the startup properties were not
set.
However I would like to leave the startup properties in tact, in case a

non-admin user logs in.
I use...
If Admin then
CommandBars("Database").Visibl*e = True ' Trying to show a menu
else 'non-admin
'non-admin code
end if
The issues are...
1. The CommandBar "Menu Bar" is displayed after the Main form is
visible, even with the startup properties set to turn off all
menus/toolbars. The menu seems limited and only related to forms and
records. The menu is definately not like the standard startup menu for
an Access database.
This seems to contradict what the startup properties suggest.
2. Using CommandBars("Database").Visibl*e = True in the OnOpen event
for
the case of admins does not show the toolbar or any other toolbar,
though I have not tried them all. I tried "Form View", "Formatting
(Form/Report)".
I do notice that the menus show up for a short duration along with the
normal default menus and then disappear after the Main form is visible.

It seems that the startup properties take effect after the Main form is

visible.
However, without restarting Access, if I restart the form (I enabled
the database window) the menus show up as coded.
But, the menus dont behave appropriately to the context of the window,
ie the "Form View" menu remains even if I click on the Database window.

Is there a way to bring up the default menu behavior for the admin case

without having to reset the startup properties and restarting?
TIA

Nov 13 '05 #1
1 11242

<ce*******@yahoo.com> skrev i en meddelelse
news:11**********************@o13g2000cwo.googlegr oups.com...
I have set the Startup properties to the following...
All menus, toolbars, etc are turned off plus these are unchecked
Allow Full Menus
Allow Built-in Toolbars
Allow Default Shortcut Menus
Allow Toolbar/Menu Changes
Use Access Special Keys
For admin users...
I would like to run some VB code in my Main startup form (OnOpen) to
show the default menu/toolbars as if the startup properties were not
set.
However I would like to leave the startup properties in tact, in case a

non-admin user logs in.
I use...
If Admin then
CommandBars("Database").Visibl*e = True ' Trying to show a menu
else 'non-admin
'non-admin code
end if
The issues are...
1. The CommandBar "Menu Bar" is displayed after the Main form is
visible, even with the startup properties set to turn off all
menus/toolbars. The menu seems limited and only related to forms and
records. The menu is definately not like the standard startup menu for
an Access database.
This seems to contradict what the startup properties suggest.
2. Using CommandBars("Database").Visibl*e = True in the OnOpen event
for
the case of admins does not show the toolbar or any other toolbar,
though I have not tried them all. I tried "Form View", "Formatting
(Form/Report)".
I do notice that the menus show up for a short duration along with the
normal default menus and then disappear after the Main form is visible.

It seems that the startup properties take effect after the Main form is

visible.
However, without restarting Access, if I restart the form (I enabled
the database window) the menus show up as coded.
But, the menus dont behave appropriately to the context of the window,
ie the "Form View" menu remains even if I click on the Database window.

Is there a way to bring up the default menu behavior for the admin case

without having to reset the startup properties and restarting?
TIA

I use the below mentioned code.
Maybe that can help you.
I set a boolean value in the Administrator screen.
The name is "tillad_menuer".

Sub SetStartupProperties()
Const DB_Text As Long = 10
Const DB_Boolean As Long = 1
tillad_menuer = DLookup("[Vis_menuer]", "parametre")
If tillad_menuer <> -1 Then
'ChangeProperty "StartupForm", , "Startform"
ChangeProperty "StartupShowDBWindow", DB_Boolean, False
ChangeProperty "StartupShowStatusBar", DB_Boolean, False
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
ChangeProperty "AllowFullMenus", DB_Boolean, False
ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
ChangeProperty "AllowSpecialKeys", DB_Boolean, False
ChangeProperty "AllowBypassKey", DB_Boolean, False
Else
'ChangeProperty "StartupForm", , "Startform"
ChangeProperty "StartupShowDBWindow", DB_Boolean, True
ChangeProperty "StartupShowStatusBar", DB_Boolean, True
ChangeProperty "AllowBuiltinToolbars", DB_Boolean, True
ChangeProperty "AllowFullMenus", DB_Boolean, True
ChangeProperty "AllowBreakIntoCode", DB_Boolean, True
ChangeProperty "AllowSpecialKeys", DB_Boolean, True
ChangeProperty "AllowBypassKey", DB_Boolean, True
End If

End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant,
varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

Private Sub Form_Activate()
DoCmd.Maximize
Call SetStartupProperties
Kode = ""
End Sub
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jason Webb | last post by:
Dear Microsoft, The current "Windows.Forms" controls included in the .Net Framework are good, but in many ways they're pretty basic, and I think it's time that you take Windows.Forms to the...
4
by: Karl Irvin | last post by:
In a 2000, can you transfer custom menus and toolbars to a new Access database. My mdf file is not compiling and I'm importing all data to a new database but don't see a way to get the...
2
by: Miguelito Bain | last post by:
Hi Everyone- I have a problem with my menu bars disappearing. Here's a little backround... I have one main database that has a page called "Prior Records." There are several command buttons...
2
by: Heather | last post by:
I'm working on a db that has custom toolbars and menus. So all the commands for editing/designing forms, etc are gone. How do I get the default toolbars and menus back? I have no way to contact...
0
by: Frank Rizzo | last post by:
I've noticed that the toolbars and menu controls got an overhaul in vs2005. Is there anyway to make them work like they do in 3rd party solutions (like infragistics or devexpress) or MFC (back in...
1
by: bjaeger | last post by:
A few months back I was "playing" with an Access 2000 application I created. I somehow disabled the delete option from all menus, toolbars, and context menus. Now I cannot do any maintenance on...
6
by: GOI via AccessMonster.com | last post by:
Good day! I was fiddling around with the Tools-Startup menu. I unchecked the following checkboxes: Display Status Bar Allow Full Menus Allow Default Shortcut Menus Allow Built-in Toolbars...
6
by: terrycr | last post by:
In an attempt to clean up my form I went to TOOLS STARTUP and removed check marks from the following: Allow full menus Allow default shortcut menus Allow built in toolbars Allow toolbar/menu...
1
by: ApexData | last post by:
I have a ShortCutMenu that is made available on the RightClick of the mouse. The OnAction property has my custom function: =ComboBoxEditor() I believe that, in the ONAction property, I could do...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.