Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How adjust Access Window size (canvas) to application size ? 1

Status
Not open for further replies.

HansL

MIS
Feb 10, 2003
17
DE
Hi,

I created a form that starts automatically.
I managed to remove the File menu on the top.

So now I have my form and grey frame (Access) around it.

Is there a possibility to adjust the grey frame to the size of the form ? Or even better just to show only the frame itself ?

Thank you !
 
Have you tried DoCmd.Maximize ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
am i right in thinking you would like to keep the form visible on the screen and hide the access window, so your form is all that can be seen?
 
Okay here it goes,
Create a New Module and copy in the following code and save it as "BasAccessHider".


Option Compare Database

Private Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Dim dwReturn As Long

Const SW_HIDE = 0
Const SW_SHOWNORMAL = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3

Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, _
ByVal nCmdShow As Long) As Long

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



Okay Now create a new Macro and call it "mcrHide"
In the action column of the Macro select "Run Code" from the drop down and put in the following function name: fAccessWindow ("Minimize", False, False)


On the onopen event of your form put in the following code
DoCmd.RunMacro "mcrHide"


Now when your form opens the access background will minimize so that only your form can be seen.
Your form properties must be set to pop-up = yes are your form will minimize too.

hope this helps



 
Why not link to mstrmage1768's faq faq705-2562?

Roy-Vidar
 
Hi AccessdevJunior

This Function works great!!!

However, I have a form that controls reports now when I preview any reports - IT stays at the back.

Can the reports be overide the main form? and set also as pop-up?

Likewise, can i also set other forms to float over the main form?

Please walk me through this...

Thanks in advance...

mybers
 
The FAQ referenced in my previous post answers this question. Please remember when copy/pasting other members posts or FAQ's we need to give them credit with a mention of their name.

Roy-Vidar
 
Hello

Anyone please...just a followup question on the Acess window Hide.

The only problem I have on the script above...was just when a Report Opens..it opens at the back instead at the front....I made the report to be Pop-up sadly...didnt do it.

more clarification on this matter please...

thanks everyone

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top