A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Minimize access windows



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2010, 08:58 AM posted to microsoft.public.access.forms
McHammer
external usenet poster
 
Posts: 4
Default Minimize access windows

Hi everybody,
I want to minimize the access windows and have my forms only in modal popup
way, with the main forms always on the background. I just found and copied a
module (see below) that does it well except for a small side effect. I have
some "animated" buttons/labels (e.g. change font size/colour/picture etc. on
click/mouse move events) on a secondary form and, after an on click event,
the access window get back. Running the same command (e.g save record and
close secondary form) from a simple button created by access toolbox (no
focus on it), everything works and the access window remains minimezed. I'd
like to keep my buttons, but I don't know how to move around this problem.
Can someone help and explain me what's going on?

Thanks in advance

McHammer
Milan, Italy

Here below the module. I just call the function fSetAccessWindow
(SW_SHOWMINIMIZED) on form load event of the main form.

Option Compare Database
Option Explicit

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)

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

fSetAccessWindow = (loX 0)
End Function
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.