Problem with shortcut menus!!! Please Help!!

G

Guest

I minimize and hide the access window when my database opens. Because of
this none of my shortcut menus show when the user right clicks. I would like
to show the shortcut menus when the user right clicks on reports so they
might have printing options. Is this possible or must I find another means
to give them printing options.

What is the best way to go about this?

TIA,
Tim J

Note: My startup otions are set to allow all shortcut menus of course!
 
T

tina

you, or somebody else, has posted this question a few times over the past
several days. since i haven't seen a solution posted, i'll have a go a
working on it if you want to post the entire code you're using to "minimize
and hide the Access window when the database opens", and tell me where
you're running the code from (startup form, autoexec macro, etc).

i'm running A2003 on Win 2K Pro, and you?
 
G

Guest

Hi tina,

I appreciate the help. Here is the code I run in a form on it's on open
event. The form opens on startup.

fSetAccessWindow (SW_SHOWMINIMIZED)
fSetAccessWindow (SW_HIDE)

You must post this code in a new module for it to work.

'************ Code Start **********
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
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)
'Usage Examples
'Maximize window:
' ?fSetAccessWindow(SW_SHOWMAXIMIZED)
'Minimize window:
' ?fSetAccessWindow(SW_SHOWMINIMIZED)
'Hide window:
' ?fSetAccessWindow(SW_HIDE)
'Normal window:
' ?fSetAccessWindow(SW_SHOWNORMAL)
'
Dim loX As Long
Dim loForm As Form
On Error Resume Next
Set loForm = Screen.ActiveForm
If Err <> 0 Then 'no Activeform
If nCmdShow = SW_HIDE Then
'MsgBox "Cannot hide Access unless " _
& "a form is on screen"
Else
loX = apiShowWindow(hWndAccessApp, nCmdShow)
Err.Clear
End If
Else
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
End If
fSetAccessWindow = (loX <> 0)
End Function

'************ Code End **********
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top