onClose event for query - does it exist?

Mr.K

Registered User.
Local time
Today, 08:01
Joined
Jan 18, 2006
Messages
104
I'm trying to execute a macro that hides a PrintMenubar when a query closes. Do queries have events associated with them like forms do? I can't find anything under properties.
Showing the PrintMenu when the query opens isn't a problem since I can put the DoCmd.RunMacro in the vba of the button that opens the query; but how can I hide it when the query closes?
 
in the same sub that calls the query, you can end it with a docmd.close

sam
 
If you put the close of the query on the same event that opened it, it won't stay open for the person to use it. You should be using forms with the query as the underlying datasource, as forms have events. You can set the form to Datasheet mode, which makes it look like the person has opened the query itself, but you have more control over it AND you have events, which queries do not.
 

Users who are viewing this thread

Back
Top Bottom