

This is a very good question and something i'm very interested in, however since this conversation is based on hidding the access window and doesnt focus on your question exactly i'm reposting it back in the forum so people will see it and answer your question.Private Declare Function FindWindow Lib " user32" Alias _ So anyway, sorry for the long explanation, but just let me know if anyone has any questions or ideas.
#Api vba showwindow code#
Here's the code I put in the minimize button's On Click event:ĭoCmd.OpenForm stDocName,, , stLinkCriteriaĮnd SubBut once the form is minimized (I realize that it's really the main database window that's minimized, because that's what's shown on the taskbar), is there a way to maximize/re-open the form (just like it is when it's initially opened) without the main database showing-up? I tried, but I couldn't figure out a way to use SetAccessWindow (SW_HIDE) again.
#Api vba showwindow windows#
I figured the users would get confused when they had multiple windows open and couldn't find the database on the taskbar. I made the minimize button so that when it was used, something would show-up on the taskbar and not on the desktop (above the Start button). I then added a button to the form so that the user can close the database, and another button so that the form can minimized. On Open: Private Sub Form_Open(Cancel As Integer)Įnd SubOn Timer: Private Sub Form_Timer()Įnd SubI also un-checked all of the check boxes in the database's Startup options menu. Like some other people who are using this code, I'm trying to make my database as airtight as possible to keep users from getting into things - accidentally or intentionally.įor reference, here are some of the properties from the main form: Although, there's 1 more thing I'd like to do, that I can't figure out. I'm using this on a couple of forms in A2002 and it's working great. Private Sub Report_Open(Cancel As Integer) In each report you need to enter the following: !!!SECOND!!! you have to paste this code into every form If nCmdShow = SW_SHOWMINIMIZED And myRep.Modal = True ThenĮlseIf nCmdShow = SW_HIDE And myRep.PopUp True Then If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True ThenĮlseIf nCmdShow = SW_HIDE And loform.PopUp True Thenįunction rSetAccessWindow(nCmdShow As Long, Optional myRep As Report)

LoX = apiShowWindow(hWndAccessApp, nCmdShow) Private Declare Function apiShowWindow Lib "user32" _Īlias "ShowWindow" (ByVal hWnd As Long, _įunction fSetAccessWindow(nCmdShow As Long) Are you properly passing this value to the API Function, something similar to:ĭeclare Function IsZoomed Lib "user32" (ByVal hWnd As Long) As Long The 'Handle' to a Report Window is defined by its hWnd Property. The above code works great on forms, but i cant get it to function on Reports. !!!SECOND!!! you have to paste this code into every form If nCmdShow = SW_SHOWMINIMIZED And loform.Modal = True ThenĮlseIf nCmdShow = SW_HIDE And loform.PopUp True Then

LoX = apiShowWindow(hWndAccessApp, nCmdShow) Private Declare Function apiShowWindow Lib "user32" _Īlias "ShowWindow" (ByVal hWnd As Long, _įunction fSetAccessWindow(nCmdShow As Long) !!!!FIRST!!! The fallowing code gets placed into a module that has to be called "SetAccessWindow"
