Note: I use the module below to make MSAccess work like a true popup (without any background type form or any upper menus). I call the function fSetAccessWindow in the onOpen event of my initial form.
Example in OnOpen event of my initial popup form...
Call Module2.fSetAccessWindow(2)
or
Call Module2.fSetAccessWindow(0)
To make the right-click work again, on a specific popup form (or report) in the onOpen event of that form simply add the below code. This turns the right-click back on while maintaining the 'true' popup style of the MSAccess project.
Call Module2.fSetAccessWindow(1)
to turn off right-clicking and keeping the popup style, make sure to
Call Module2.fSetAccessWindow(2) in the onclose event of the popup form.
or
Call Module2.fSetAccessWindow(0)
Note that when calling the function to show the menus 'normalized' (ie. 1) will temporarily show the MSAccess background menus/navigation when the form is opened. If you set the modal property of the popup form to yes, the user will only be able to work with the popup form and not be able to set the focus to the msaccess background form.
Option Compare Database
Option Explicit
Global Const SW_HIDE = 0
Global Const SW_SHOWNORMAL = 1
Global Const SW_SHOWMINIMIZED = 2
Global Const SW_SHOWMAXIMIZED = 3
Private Declare Function apiShowWindow Lib "User32" _
Alias "ShowWindow" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long
Function fSetAccessWindow(nCmdShow As Long)
'This api is used to remove the MSAccess information and only show the form.
'Code gotten from the web. Paul Kohn 7/23/07.
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
If nCmdShow = SW_SHOWMINIMIZED And loForm.Modal = True Then
MsgBox "Cannot minimize Access with " _
& (loForm.Caption + " ") _
& "form on screen"
ElseIf nCmdShow = SW_HIDE And loForm.PopUp <> True Then
MsgBox "Cannot hide Access with " _
& (loForm.Caption + " ") _
& "form on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
End If
fSetAccessWindow = (loX <> 0)
End Function