Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to run a query without showing view of a query

Status
Not open for further replies.

xq

Programmer
Jun 26, 2002
106
NL
i've written a bunch of queries, with will compare other database with my one and update my database in certain way, and which is ran everytime the database is openned, but i don't want user to see what is happening behind, is there a way of closing the view of a query?
thanks a lot!
 
Echo should do that.

In macro: Action=Echo Off

In code:

DoCmd.Echo False
'code here
DoCmd.Echo True

Don't forget to switch it to True when finished, otherwise you won't be able to control anything in the application.
Especially don't debug the code step by step and set the Echo to False...

HTH
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
thanks, but it doesn't work.
 
What's your code? I have a form that does something similar and my code is:

Sub MyButton_Click()

DoCmd.Echo False, "Status bar: Have a coffee...program running"
DoCmd.OpenQuery "QueryOne"
DoCmd.OpenQuery "QueryTwo"
DoCmd.Echo True, "Status bar: Ok, have you finished your coffee?"
End Sub

alternatively, have you considered using:
DoCmd.RunSQL "SqlStatementHere"
or
CurrentDb.Execute ""SqlStatementHere"
instead of plainly running the queries?

HTH
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
i simply put all the queries in a macro, i set action echo to No, and set rest all the queries, last action is set echo back to Yes. did i do it right?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top