468,733 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,733 developers. It's quick & easy.

Maximizing Access Report From VB

This is my first try at running Access Report by Visual Basic

I have the following code in my button press event:

' 2 - Show print preview
objAccess.DoCmd.OpenReport "Invoices", 2, ,
"[Invoice_Summary].[InvoiceNumber]=" & _
intCurrentInvoice

objAccess.DoCmd.Maximize
The result is that the Access application is not maximized but the
report inside it is. The application takes up about two thirds of the
screen. Then, if I maximize the application window, everything is
fine.

I would like everything to be max when the user sees it.

How can I maximize the Access application as well as the report inside
it.

Thanks.

Bill
Jan 7 '06 #1
3 3459
Newbie wrote:
This is my first try at running Access Report by Visual Basic

I have the following code in my button press event:

' 2 - Show print preview
objAccess.DoCmd.OpenReport "Invoices", 2, ,
"[Invoice_Summary].[InvoiceNumber]=" & _
intCurrentInvoice

objAccess.DoCmd.Maximize
The result is that the Access application is not maximized but the
report inside it is. The application takes up about two thirds of the
screen. Then, if I maximize the application window, everything is
fine.

I would like everything to be max when the user sees it.

How can I maximize the Access application as well as the report inside
it.

Thanks.

Bill


Howody, to all the others in this crosspost. Anyway....

Normally, in the Access Report's OnOpen event I have the following line
DoCmd.Maximize
if I want to open the report maximized.

I don't know if this will help you but....
http://www.mvps.org/access/api/api0018.htm

This shows how to open an app in min/max/normal modes using an API call.
I don't see you opening the app anywhere, but if the app is opened in
a maximized state, I'm sure the report would be displayed correctly in a
maximized state. Maybe you need to do something with a WinAPI call.

Also, check out Shell() in VB. It too has a window state to open an app
in the window style you specify.

Jan 7 '06 #2
On Sat, 07 Jan 2006 05:00:08 GMT, salad <oi*@vinegar.com> wrote:
Howody, to all the others in this crosspost. Anyway....


What's wrong with posting to more than one group as long as it's on
the same message?

Thanks for your answer to my question. It was very helpful.
Jan 7 '06 #3
Newbie wrote:
What's wrong with posting to more than one group as long as it's on
the same message?


Hi there,

There's nothing wrong with doing so. However, if you are talking about
Access and are doing your work in it, you're using VBA, not VB, which
would make the two vb groups not really relevant to your question.

8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Jan 7 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Bob Alston | last post: by
2 posts views Thread by amith.srinivas | last post: by
xarzu
2 posts views Thread by xarzu | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.