473,549 Members | 2,708 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent Custom Menu From Appearing

Hey group!

I have a toolbar with a "DEVELOPER" menu. I have it so that it when the
menu title is clicked, a pop-up form will appear if the user has not
yet verified that he or she has developer privileges (this menu only
appears when the user is set up as a developer, but i'm a bit paranoid
on these matters i guess).

My problem is that when the menu title is clicked, the form appears but
so does the menu, and the menu has the focus, so the user has to
manually click the window. A minor inconvenience, but one I'd like to
be rid of.

I've temporarily patched this with a sendkeys (i know, i know), as when
a button is pressed, the menu closes and the form takes focus.
Obviously, I want to be rid of the sendkeys.

Any ideas? If not, I could always just scrap the validation and rely on
the visible property when the user record says its a developer.

Thanks for any tips of tricks you can pass on.

Nov 13 '05 #1
4 1916
je************@ gmail.com wrote:
I have a toolbar with a "DEVELOPER" menu. I have it so that it when the
menu title is clicked, a pop-up form will appear if the user has not
yet verified that he or she has developer privileges (this menu only
appears when the user is set up as a developer, but i'm a bit paranoid
on these matters i guess).

My problem is that when the menu title is clicked, the form appears but
so does the menu, and the menu has the focus, so the user has to
manually click the window. A minor inconvenience, but one I'd like to
be rid of.


I can't figure out what you're talking about here - I get the impression
that the first toolbar you mention in para 1, above, that a menu control
called "DEVELOPER" is supposed to be clicked, making a pop up form appear.

But then you talk about another "a menu appears" when the pop up form
appears. What menu? The one you were first talking about? Also, I'm
not sure what you mean when you say "the user has to manually click the
window". what window? The pop up?

The above confusion aside, here are a couple of _separate_ options:

1) Make the pop up form modal as well. That way the menu can't be
clicked and the form will have the focus; or

2) Presumeably the "DEVELOPER" menu item has a function associated with
it that checks to see if developer privileges have been confirmed, and,
if not, performs a docmd.openform. You could use the acDialog argument
for the window mode argument of this docmd method; or

3) In the same function as described in 2, above, after the form is
opened, use the setfocus method to put the focus on the form or a
control on the form.

If this doesn't help, you'll need to clarify what I describe in para 2
of my response, above.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Sorry for the confusion.

In the toolbar, there is a menu. For reference, we'll compare it to the
file menu.
When you click the word "File" it drops down a menu with New, Open,
etc.
Similarly, in my db, when you click "Developer" , it drops down menu
with VB Editor, etc.
The menu has an OnAction when you click "Developer" that pops up a
modal pop-up form "frmDevelop er" that does authentication.
However, when the menu (the word "Developer" ) is clicked, both the
frmDeveloper and the menu appear (menu being the VB Editor, Show DB
Window, etc.), but the form doesn't take the focus. When you type when
the form comes up, the first keypress just closes the menu and gives
focus to the pop-up, so if i click "Developer" and key in "Password",
the form would receive "assword", hence the original sendkeys.
I tried the acDialog idea, but the form still doesn't take focus.
Keypresses go to anything but the form.

I really hope this clarified things, though I probably only made things
worse.
Thanks for trying anyway.

Nov 13 '05 #3
je************@ gmail.com wrote:
Sorry for the confusion.

In the toolbar, there is a menu. For reference, we'll compare it to the
file menu.
When you click the word "File" it drops down a menu with New, Open,
etc.
Similarly, in my db, when you click "Developer" , it drops down menu
with VB Editor, etc.
The menu has an OnAction when you click "Developer" that pops up a
modal pop-up form "frmDevelop er" that does authentication.
However, when the menu (the word "Developer" ) is clicked, both the
frmDeveloper and the menu appear (menu being the VB Editor, Show DB
Window, etc.), but the form doesn't take the focus. When you type when
the form comes up, the first keypress just closes the menu and gives
focus to the pop-up, so if i click "Developer" and key in "Password",
the form would receive "assword", hence the original sendkeys.
I tried the acDialog idea, but the form still doesn't take focus.
Keypresses go to anything but the form.

I really hope this clarified things, though I probably only made things
worse.
Thanks for trying anyway.


OK, I think I see. The Developer menu item is a menu of it's own *and*
there is an action associated with it.

I don't think it's very intuitive to have a function associated with a
drop down menu, myself.

What about doing this.

You must check to see whether or not the user has been authenticated.
Do this in a public function in a standard module with a boolean result.
If the person is authenticated, the result will be true, otherwise,
false. Let's call this function fAuthenticate() for argument's sake.

Now, in each of the function associated with the actions on all the menu
items under Developer, include the following (air code):

Function fShowDbWindow()

if fAuthenticate() = False then

if msgbox("If you wish to proceed with opening the DB window, You
must first be assimilated!" & vbcrlf & vbcrlf & "Continue?" , vbQuestion
+ vbOKCAncel, "Authentica tion Required!") = vbOK then

docmd.openForm "frmDevelop er"

end if

else 'user has already been authenticated

'do stuff

end if

End function

I think you'll find this to be better from a user convenience point of
view. I had one developer try to do an application for my department
once and she had all kinds of actions associated with drop down menus.
It was irritating as all hell. Think to yourself if you've ever
encountered this sort of thing before.

Another option would be to have the menu items disabled or invisible.
say your menu bar is called mnuMain. Have the first item on the
Developer menu be "Autehntica te". The on open event of your splash or
opening form could have a call to a public function that does this:

if fAuthenticate() = False then

commandbars("mn uMain").control s("DEVELOPER"). _
controls("dbWin dowItem").enabl ed = false

commandbars("mn uMain").control s("DEVELOPER"). _
controls("VBA Menu").enabled = false

'etc

else

commandbars("mn uMain").control s("DEVELOPER"). _
controls("dbWin dowItem").enabl ed = true

commandbars("mn uMain").control s("DEVELOPER"). _
controls("VBA Menu").enabled = true

'etc

end if

The authenticate menu item opens frmDeveloper and after a successful
authentication on the frmDeveloper form, call the function containing
the above if statement.

So that's my advice. Sorry it's not a fix, but I've given you two
better, IMHO, alternatives.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #4
The funny thing is, I already have it set up so that only those users
with developers access can even see the developer menu. I just had a
residual form from when i was gonna do it another way and i decided why
not keep it anyway. I guess i'll just toss it if its gonna be a pain.
Shame tho, I rather liked the design of that form. lol

thanks

Nov 13 '05 #5

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

Similar topics

2
2272
by: Sean Mullaly | last post by:
I have a custom Access menu with sub-menus and sub-sub-menus. (220 items). Right now I have created 220 Functions and attached each individual Function to the specific OnAction property. The Functions return Text which is the same as the Caption of the sub-sub-menu items. I would like to reference the Custom Popup Caption of these...
0
332
by: Fatz | last post by:
I have a table that is an autonumber field. This table appears as a subform in another form. I want the ID# to show in the subform...but I don't want the (Autonumber) to show at the bottom of the subform. Is there anyway to prevent the last field in my table that has the ID (Autonumber) from appearing in the sub? Thanks! Chris
7
1711
by: Ian Hinson | last post by:
I have an Access app that has been distributed with run-time installation to many different customers over many years. It is developed in Access 2000. The custom menu bar has had no problems in the past. However on one new computer it was installed on last week the custom 'Tools' menu (which normally contains items such as 'Backup Data' and...
1
1205
by: Vadim | last post by:
Our program is planing to often download generated reports in MS Word and it's hihg unlikely to bother uthers to push buttons in appearing download dialog for our corporate site. How to prevent this dialog for trusted sites ?
4
6955
by: jon morgan | last post by:
Hello, In an MDI application how can I prevent the CLR automatically merging a child windows' menu with that of the parent MDI form ? Thanks for any help Jon
16
6248
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
27
45508
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...
5
2401
by: lorirobn | last post by:
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...
2
2272
by: AjitGoel | last post by:
Hi; I need to create a custom textbox control which will not allow a user to paste text from the clipboard. The user has to always type the text into the textbox. I tried searching on the internet since I guessed someone would have faced this problem before but of no avail. Do we have pointers on how I should go about doing this??
0
7451
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7475
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...
0
7812
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...
0
6048
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...
1
5372
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...
0
5089
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...
0
3501
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...
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.