473,765 Members | 2,086 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2409
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("mn uMain").Control s(3).Enabled = true
Case else 'Read only user/group
Commandbars("mn uMain").Control s(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
6787
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 whatever) from one database to another, because it's an interface import option. I'm happy to slog through coding it myself, but I need a few pointers. Anyone out there done this, or found code templates for it? Seems like the CommandBar object
27
45564
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 height as they were in previous versions or will they be the "ribbon" style that takes up a huge portion of the screen? Also when I use Access 2007 to open an Access 2003 database that has custom menu bars they display as they did in Access...
1
3030
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 there a way to copy a custom menu bar and give it a different name. The current Admin menu bar has a large number of items. To recreate it would probably take several hours. So if I could copy it, give it a different name and then remove...
2
3176
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
4563
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 custom menu bar to display on startup. However is it possible to achieve this from within the earlier version, perhaps by using code, so that one doesn't have to use A2007 to set the custom menu bar? It seems that even if an application written...
11
3207
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 move the menu bar onto the VB form, how do I do this? Thank-you in advance.
3
3258
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 Toolbars -> Customize, but whenever I try to run the project elsewhere (ie. on a different machine), the menu bars have reset. How can I ensure that my project will display the same custom menu bar on any computer running Access 2003? Thanks.
13
2883
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, '2' for supervisor, '3' for regular users. How do i set selected menu bars to be "read-only" if the user access level is "3". Thanks.
6
2536
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
9566
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10153
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9946
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8830
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.