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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Access object on full screen

Status
Not open for further replies.

iren

Technical User
Mar 8, 2005
106
US
I am new in this stuff.
When I open Access from VB like Object VB, I can not open
Access object on full screen. How I can do it.?
Tanks for any help.
 
As far as I know, the only option is to use the Windows API
Put this in your declarations:

Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Const SW_MAXIMIZE = 3
Private Const SW_NORMAL = 1

Then do something like this:
Sub OpenReport
dim hWnd as long
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("C:\...")
hWnd = FindWindow("OMain", "Microsoft Access")
If hWnd <> 0 Then
ShowWindow hWnd, SW_NORMAL
ShowWindow hWnd, SW_MAXIMIZE
End If
objAccess.DoCmd.OpenReport &quot;rptMonthlyConsumptions&quot;, acViewPreview
objAccess.DoCmd.Maximize


I did have some problems setting some properties after using the ShowWindow function, so if you need to set any other properties, you may want to do that before calling the api functions.

Shanti Miller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top