Display Query from form in Foreground

  • Thread starter Thread starter rmcompute
  • Start date Start date
R

rmcompute

I have a form upon which the user selects display, filter and sort fields.
He then clics the submit button and a query is built and then displayed with
the following code:

DoCmd.OpenQuery "Queryname", acNormal, acEdit

The query works but shows up in the background and cant be clicked on until
the form is closed. The idea was to create a form on which the user could do
adhoc queries until he gets it right and then click another button to do the
Excel extract. Is there a way to show the query in the foreground?
 
I have a form upon which the user selects display, filter and sort fields.
He then clics the submit button and a query is built and then displayed with
the following code:

DoCmd.OpenQuery "Queryname", acNormal, acEdit

The query works but shows up in the background and cant be clicked on until
the form is closed. The idea was to create a form on which the user could do
adhoc queries until he gets it right and then click another button to do the
Excel extract. Is there a way to show the query in the foreground?

Just close the form after opening the query:

DoCmd.OpenQuery "Queryname"
DoCmd.Close acForm, Me.Name

acNormal and acEdit are default properties. No need to state them.
 
Can you click on other items when the form is open?

How is the form opened? Is it opened in DIALOG window mode? If so, can you
change the window mode to Normal?

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Thanks. I did as you suggested, closing the form after opening the query. I
was wondering if there was a way that the query could display in the
foreground, since the user will continually refine his selection until he
gets the required data, I did not want him to have to re-enter all the
information.
Thanks again.
 
Thanks. I did switch from dialog mode to normal, however, I was still not
able to click on the query which came up in the background while the form was
opened. The only way to click on the query was to close the form. If there
was a way to shift control to the query this would solve the problem. Thanks.
 
Thanks. I did switch from dialog mode to normal, however, I was still not
able to click on the query which came up in the background while the form was
opened. The only way to click on the query was to close the form. If there
was a way to shift control to the query this would solve the problem. Thanks.

Try it this way.

DoCmd.OpenQuery "QueryName"
Me.Visible = False

The form will be not visible when the query is viewed. When you close
the query, select the form again on the main database folder and it
will become visible again with the same data as before.
 
It worked! Thank you!

fredg said:
Try it this way.

DoCmd.OpenQuery "QueryName"
Me.Visible = False

The form will be not visible when the query is viewed. When you close
the query, select the form again on the main database folder and it
will become visible again with the same data as before.
 
Back
Top