I use the following function with the SW_SHOWMINIMIXED parameter to hide the
main access window.
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
when I then use
CommandBars![MenuName].ShowPopup
I get
Method Showpopup of Object 'CommandBar' failed.
Alec
Rick Brandt said:
Paradigm said:
My application has more than 80 different mde files as a front end
(all managed by a control panel) each of these may have upto 20-30
different forms and hundreds of reports in them and all based on more
than SQL 250 tables.
I think the main Access window with its grey background confuses my
users, e.g. maximize a form and it only maximises it in the window
and then they have to maximise the window as well. This is not how
normal, standard windows apps usually work. I control which form is
visible and all forms are popups with some being modal. When I
display a report preview I hide all forms so that only the report is
visible and when it is closed the appropriate form is then
redisplayed.
Each form uses a number of command buttons appropriate to the form.
If I was using menus in the main window I would require dozens of
them in each mde file and have to keep switching the menus depending
on what I want the user to be able to do at any point in time.
The only reason I need a menu on a form is that I sometimes run out
of space on the form for all the options.
I just tried the Shortcut menu method previously described in my one app
that hides the Access window and the menu still worked fine for me. I use
the command...
CommandBars![MenuName].ShowPopup