Starting an MDE w/switchboard ONLY - no other window

scottm91

New member
Local time
Today, 10:01
Joined
Sep 19, 2011
Messages
9
I'm creating an MDE and have it all worked out, but I want it to open ONLY my switchbard, like a popup - not the Access window. I've got it so that it opens the switchboard in a dialog window but the Access window opens behind it. I don't want it. I know how to turn off the navigation pane and toolbars, but can't get rid of the blasted Access window. Any tips? Using Access 2007
 
I've not used this myself, and never in 2007, but it works in 2003.

Put this in a module:
Code:
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
    If IsWindowVisible(hWndAccessApp) = 1 Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
End If
If StatusCheck = True Then
    If IsWindowVisible(hWndAccessApp) = 0 Then
        fAccessWindow = False
    End If
    If IsWindowVisible(hWndAccessApp) = 1 Then
        fAccessWindow = True
    End If
End If
End Function

Then run the following function when you open the switchboard (or use the autoexec macro to "RunCode" to launch the function if you prefer):

Code:
fAccessWindow ("Minimize", False, False)

You can also restore the window:
Code:
fAccessWindow ("Show", False, False)
 
Thanks, but that didn't seem to work. I had some error messages and the mere presence of a module seemed to interfere with the MDE file being saved properly. I've noticed that Access 2007 is a very different beast than its predecessors. Don't know why they took away the Startup Options window - it was very easy and straight-forward.

I may work on this a bit more but for now I've got bigger Access fish to fry. Still open to ideas if anyone has a known fix for Access 2007.

I've not used this myself, and never in 2007, but it works in 2003.

Put this in a module:
Code:
Public Function fAccessWindow(Optional Procedure As String, Optional SwitchStatus As Boolean, Optional StatusCheck As Boolean) As Boolean
If Procedure = "Hide" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
End If
If Procedure = "Show" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
End If
If Procedure = "Minimize" Then
    dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMINIMIZED)
End If
If SwitchStatus = True Then
    If IsWindowVisible(hWndAccessApp) = 1 Then
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_HIDE)
    Else
        dwReturn = ShowWindow(Application.hWndAccessApp, SW_SHOWMAXIMIZED)
    End If
End If
If StatusCheck = True Then
    If IsWindowVisible(hWndAccessApp) = 0 Then
        fAccessWindow = False
    End If
    If IsWindowVisible(hWndAccessApp) = 1 Then
        fAccessWindow = True
    End If
End If
End Function
Then run the following function when you open the switchboard (or use the autoexec macro to "RunCode" to launch the function if you prefer):

Code:
fAccessWindow ("Minimize", False, False)
You can also restore the window:
Code:
fAccessWindow ("Show", False, False)
 
Thanks, but that didn't seem to work. I had some error messages and the mere presence of a module seemed to interfere with the MDE file being saved properly.

Nope, the mere presence of a module wouldn't be the problem. You would need to run DEBUG > COMPILE to find the compile error that the procedure(s) in the module have with your database.

And did you put the code that was provided to you in a STANDARD module and NOT in a form, report, or class module? If not, it needs to be.
 

Users who are viewing this thread

Back
Top Bottom