473,405 Members | 2,415 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,405 software developers and data experts.

Popup/context menus not showing in modal forms

I have created many shortcut/popup (aka context, or right-click) menus for my
application - instead of toolbars or standard drop-down menus.

Within my custom menu, I am using =ShowMainMenu("item") in the On Action
event where ShowMainMenu is a public function in frmMain, and "item" is a
string mapping to a button click event.

(error trapping omitted)

Public Function ShowMainMenu(strItem As String) As Boolean

Dim blnResult As Boolean

Select Case strItem

Case "firstItem"
cmdFirst_Click
Case "secondItem"
cmdSecond_Click
End Select

ShowMainMenu = blnResult

End Function

(each form has a variation on this function)

It appears that my menus work fine in forms that are not modal dialog
windows, but the modal ones seem to block the communication between the menu
and the form. I have a break set on the function, but it never trips.

I have a few forms that are opened modally AND non-modally depending on the
calling form. Modal = no workie.

Is this a known limitation? Is there some sort of setting somwhere or VBA
code I can write to work around this?

Jun 27 '08 #1
2 3473

It is entirely possible that you're confusing the issue between dialog
forms, and what are known as model forms in MS access.

Dialog forms do not allow the cursor/focus to use any of the custom or built
in menus at all. The behavior is the same as if in code you displayed a
msgbox command. Now how when using a msgbox command you can not use menus,
or have the focus move to anything other than that actual form (or dialog
box). This includes also the built in menus, or in your case custom menu
bars, they simply cannot be used in any way shape or form when you use a
dialog form. (or the msgbox command...you can even try this from the debug
window, and type in:

msgbox "hello"

now, try and use the menus...you can not untill you hit ok.
It appears that my menus work fine in forms that are not modal dialog
windows
modal disalog form??? Model forms, and dialog forms are VERY VERY much
different animals.
I have a few forms that are opened modally AND non-modally depending on
the
calling form. Modal = no workie.
The above information is likely incorrect, since the openform command has NO
way of setting a form as modal, or non model via the open command. You can
certainly supply the acdialog parameter, and the form will open as dialog,
but that is NOT the forms model setting, and is very much a differnt setting
alltogher.

If you want to open a form as model in code, then you have to go:

dim strF as string

strF = "name of my form goes here"

docmd.OpenForm strF
forms(strF).modal = true
>
Is this a known limitation? Is there some sort of setting somwhere or VBA
code I can write to work around this?
Keep in mind the difference between modal, and dialog forms, I explain the
difference here:

http://www.members.shaw.ca/AlbertKal...log/Index.html

are you use you need dialog forms, or will a modal form suffice?

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com

Jun 27 '08 #2
"Albert D. Kallal" <Pl*******************@msn.comwrote in
news:6jQRj.100707$rd2.81244@pd7urf3no:
>
It is entirely possible that you're confusing the issue between dialog
forms, and what are known as model forms in MS access.
Yes, you nailed it. That's exactly what happened. I've been opening forms
with acDialog, thinking that gives me a modal form. I may have never
discovered it if I hadn't tried to implement custom menus. Doh!

If you want to open a form as model in code, then you have to go:

dim strF as string

strF = "name of my form goes here"

docmd.OpenForm strF
forms(strF).modal = true
So the second line is executed before the form opens?

It appears that I can do Me.Modal = True in my Form_Open event. Is that
equivalent?
are you use you need dialog forms, or will a modal form suffice?
Modal forms are exactly what I need, and I can now go and rewrite all my form
opening code to do away with acDialog (except in the few cases I might need
it). Thanks for the quick education!
Jun 27 '08 #3

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

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
4
by: Newbie | last post by:
Hello all~ I have got some questions about popup window, hope that someone can help me.. m(_ _)m~thx~ when a popup window appear, can I force users to focus on the popup window "ONLY" that...
3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
0
by: Alireza Haghshenass | last post by:
Dear All, I am facing a problem which I could not solve. I am writing an application which uses a notify icon and a context menu bound to it to show modal dialog forms. When these forms is shown...
0
by: Dino M. Buljubasic | last post by:
I have several context menu added to my forms. The forms are displaying items in a list view. When I click on an item in a list view, a popup context menu shows allowing me to chese between...
11
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
4
by: ksbjr | last post by:
I have a need to arrange the relative depth of several non-modal popup forms. Specifically, I need to make sure one particular form is always at the back of the others. That is, if a user happens...
5
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Have a couple of issues with the modal popup extender (asp.net 3.5, vb.net, visual studio 2008): I have created a user control (e-mail enquiry form) which is designed to accept text...
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: 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...
0
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...

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.