Question Modal Form Close

mm07nkb

Registered User.
Local time
Today, 20:26
Joined
Sep 1, 2011
Messages
23
Hi

I have a modal form which has a button on it that when I press it opens a query. how do I get this modal form to hide behind the query when it opens?

I have managed to do it for a report but I dont know where to add vba codes in for a query.

Thanks for any help!
 
Why not just hide the form in the click event of the command button?

Me.Visible = False
 
I have a 'form1' which when you click a button it opens up the modal form. I have set this so that the 'form1' doesnt close when the modal form pops up.

On the modal form if you click the button it opens up the query. If I put the above code in the modal form it hides but the query opens behind 'form1'.

How do I get the query to open infront of 'form1' as I need this to stay opened on the database otherwise i would be just left with a query and no forms if i wanted to go back.

Thanks! hope it makes sense i should have been clearer before!
 
The solution is not to open the query directly. You generally should not open queries or tables directly unless you are doing design/testing. Create a form to display the query results and open the form. This not only allows you to control what the users can do with the query results, but also allows you to control what happens when the form opens/closes (via the various form events).
 
Is there no other solution as I need the user to open the query because I need the information to be able to be copied over into excel so they can plkay around with graphs etc on it.

The users of my database have no knowledge of access!!
 
So use Datasheet view for the form. It will look exactly like the query when it's opened, users will be able to copy/paste (if that's what you're doing - although a better option would be to transfer the query results to Excel for them using TransferSpreadsheet, etc.), but you'll still be able to take advantage of the form events to control what happens when it is opened/closed.
 

Users who are viewing this thread

Back
Top Bottom