473,386 Members | 1,830 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,386 software developers and data experts.

2 custom menu bars, depending on permissions?

Hi,

I am trying to create two custom menu bars for my application, one for
read-only users (without delete record), and one for update-access
users (with delete record).

I only need File and Edit options. File will be the same on both, but
Edit will have different options.
When I create an Edit menu on the custom menu bar, and then modify it,
it seems to also be changing the Edit menu on the other custom menu,
AND the Edit menu on the default Menu Bar. I'm thoroughly confused!

This is my first attempt at creating menu bars. Here are the steps
I've been following:
>From Tools, I go to Customize, New. I change the property from
Toolbar to Menu Bar. I copy the Edit Menu from my default menu bar on
the top of the page by pressing <CTRLand EDIT and dragging it to my
new custom menu bar. I drag unnecessary items off the new custom Edit
menu. But then when I look at either the first custom menu bar I
created or my default one on top, they are both missing all the items
I dragged off.

Can you have several Edit menus with different options, and display
just one at a time?

I want to have 2 custom menu bars, then in my startup VBA, use just
one depending on the user's permissions. I have that all coded, but
it's the creation of the custom menu bars that I seem to be struggling
with.

Many thanks -
Lori

Jan 30 '07 #1
5 2388
ps - I am using Microsoft Access 2003, and I have checked "Microsoft
Office 11.0 Object Lib" in References.

Jan 30 '07 #2
lorirobn wrote:
I am trying to create two custom menu bars for my application, one for
read-only users (without delete record), and one for update-access
users (with delete record).
It's been a little while since I used mdws and I'm at home away from my
work where I have secured Jet apps.

But rather than two separate menu bars, my approach would be to have
one. This makes it much easier to maintain, IMO.

Your startup form or code in your autoexec macro could have code similar
to the following air code. It assumes the menu bar is called "mnuMain"
and that the delete control is the third menu item along mnuMain:

Select case Currentuser 'or group identifier
Case "Full Access User1", "Full Access User2", etc
Commandbars("mnuMain").Controls(3).Enabled = true
Case else 'Read only user/group
Commandbars("mnuMain").Controls(3).Enabled = false
end select

You should not rely on this code however, just in case there is some
kind of odd unanticipated occurance that has the delete menu control
enabled for read only users. You can include code in your delete
function that is assigned to the onaction property of the control item 3
to check the user and display "You cannot delete these records" or
something in a message box. Of course, your permissions would take care
of this sort of thing.

--
Tim

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Jan 30 '07 #3
Hi Tim,

Thanks - that is really helpful. I didn't know I could disable an
item on a menu drop-down.
However, it still leaves me with the other problem I'm encountering.
When customizing a new menu, as I alter the new menu, I seem to also
be altering my original menu bar. I feel I am doing something wrong,
but what?
For example, I create a new menu bar called Test1. On it, I have File
and Edit. On Edit, I delete everything except one item, "Cut" (just
as an example). When I look at my original main menu bar, the Edit
menu has lost everything except "Cut". So now the main Menu Bar's
Edit menu matches my new custom Test1 Edit menu. Or at least the
main menu bar that I am looking at on my window (although if exit
Access and come back in and disable Test1, the main Menu Bar is as it
should be, with all options).

I hope this makes sense!

Jan 30 '07 #4
lorirobn wrote:
For example, I create a new menu bar called Test1. On it, I have File
and Edit. On Edit, I delete everything except one item, "Cut" (just
as an example).
What you should do when dragging built-in menu items from the various
types of existing menu controls, is hold the control key before you do this.

IOW, when in menu customization, create a new menu (or tool) bar. If
all you want is, for example, the cut menu control, hold down your
control key and then drag the cut control from the actual built-in menu
to the new menu/tool bar. You won't hurt anything existing that way! 8)

I'm not 100% certain if disabling a copy of a built-in item like this
will affect the original - I don't think it will, but try it. If it
does, you'll need to make your own edit function and set it up as the
onaction property, ie =fMyFunction().

BTW, presumeably you know how to reset the default menu configuration
when it gets unintentionally changed the way you describe?
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Jan 31 '07 #5
Hi Tim,
I received your email after I got help from a co-worker, and now
realize I was setting up my new menu incorrectly. I was not using the
"create a new menu" option! Instead, I was just dragging (while
holding control key) the Edit menu. This was the big "aha" moment!
Create a New Menu is the last option within the Commands Tab on the
Customize pop-up. I didn't know about this.

Soooo... all is working fine now. Thank you so much for your help. I
will take your advice and only use one menu bar, and dim the one item
that's not used by everyone, too.

Lori

Jan 31 '07 #6

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

Similar topics

12
by: downwitch | last post by:
Hi all, I've read through the archives on this, and scoured the web, to little avail. There has to be a way to move custom menu bars (or menubars, or command bars, or popup command bars, or...
27
by: Wayne | last post by:
I've been clicking around Access 2007 Beta 2 and can't see the custom menu bar designer. Is it in the beta? Maybe I'm blind. The question that comes to mind is: Will custom menu bars be the same...
1
by: rdemyan via AccessMonster.com | last post by:
I have custom menu bars for Admins and Users. I now need to add a new group call 'DataEntry'. Their custom menu bar will be very similar to that for Admins, with just a few items removed. So, is...
2
by: Keith Hutchison | last post by:
G'day Is it possible to do custom context sensitive menus within MS Access. If yes, does anyone have a sample example? Thanks in advance Keith
2
by: Wayne | last post by:
I know that it is possible to force Access 2007 to the display custom menu bars for an Access database developed in an earlier version by using the customisation settings in A2007 to nominate a...
11
by: Stwange | last post by:
I'm looking to add custom menu bars to a VB program. It was actually written in VBA with Access, and I have a custom menu on the access menu bar, but I want to hide the access window, so I need to...
3
by: Stwange | last post by:
I am close to completing my current project, but before I deploy it, I would like to place custom menu bars on either the forms (preferrably) or the Access menu bar. I know how to do this using...
13
benchpolo
by: benchpolo | last post by:
I have a custom menu bar in MSAccess (DeskOrgz> and this menu bar contains several submenu bars. I also have a user login screen where the users are defined by level of access such as '1' for admin,...
6
by: Neil | last post by:
I have a form that has its own custom menu bar in Access 2000. I'd like to make a copy of the menu bar and use it with another form. How can I do this? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.