We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

open query from code - restore window

Medium Priority
530 Views
Last Modified: 2013-12-25
Hi Guys

I am using this vb code
DoCmd.OpenQuery sql, acViewNormal, acReadOnly
to open a query, but it opens maximized, i would like to open it in a restore size(no minimized, no maximized), also is there any way to open in a Dialog mode, so user has to close it before going some place else

Please advice
Comment
Watch Question

Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
I do not need a tabbed window, and the overlaping option opens it maximized, i need to open a new window  as popup window, that i can see what is in the background
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
When I open an Overlapping widow in Access 2007 it opens Restored (not maximized).
So I can't say that I know why this is happening to you.
(Are you sure there is no code on the form to maximize it on Open or Load?)

You can only open Forms and Reports as True "Pop-ups" (Dialog, Modal), not Tables or Queries.

JeffCoachman

Author

Commented:
No there is not code behind that will maximized it, thanks
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
Can you post a small sample that exibits this issue?

Author

Commented:
DoCmd.OpenQuery sql, acViewNormal, acReadOnly

where sql is the name of the query
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
I meant a sample database...

Author

Commented:
what do you mean sample data, it is a query with 10 fields, i just need it to open not maximized
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
Again:,  Sample *DATABASE*.

I cannot replicate your issue.

If you post a sample of an actual database file that exibits the issue, it would help in troubleshooting.

JeffCoachman

Author

Commented:
the database is too big.

this is the code line that i am using

DoCmd.OpenQuery sql, acViewNormal, acReadOnly

When i choose a query and then hit "Open query" it opens it but maximized, so i loose view of the main form

queryform.jpg
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Jeffrey CoachmanMIS Liason
CERTIFIED EXPERT
Most Valuable Expert 2012

Commented:
<i do not want to put more forms to my db>
Why not?

<putting sql as a record source in the form and delete the query>
Same problem would result...
:-(

Author

Commented:
well, i can work with the maximized query, i mean it is not a big deal, thanks for all your time and help
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.