resize main access window - hide access when form is opening

behedwin

Active Member
Joined
Dec 10, 2014
Messages
399
Hey
Im trying to find a way to hide the access window when a user opens the database.
I want the user only to see the pop-up form that is displayed on opening the file.

I have tried two ways

This:
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo

and then a function like this
Code:
Option Compare Database
Option Explicit

'''HIDE WINDOW MODULE
'''USE THIS TO ACTIVATE HIDE WINDOW MODULE
''' SixHatHideWindow(SW_SHOWMINIMIZED)

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 SixHatHideWindow(nCmdShow As Long)
    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
    SixHatHideWindow = (loX <> 0)
End Function

both do work as they intended to do.
but it is not good enough for me.

both are still showing the access window when alt tabbing around when working with the access file.
it works if the user only works in the access file, but if alt tabbing somewhere and then back, the access window is back in the background.

however i am thinking of a solution.
instead of any of those codes above.
is there a some way i can force the main access window to get a preset size?
i want to make it small so it is not noticed and more or less hide behind the forms that the user are working on.
this would solve everything for me i think.


anyone able to help me with this?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top