Need help to combine severaal queries in one click!

  • Thread starter Thread starter Will
  • Start date Start date
W

Will

Hi all,

I have several queries that perform such steps as update
the records and extract only one field after that(that
output results to screen). I have buttoms designated to
each but I wonder if there is a way to combine both
queries under one buttom/click and do not output update
message prompt and query results to the screen, just to
perform operation in silence mode.
Also need help with code to save the query results to a
specific location as txt file with no column heading...
Thanks a lot!!!

Will
 
How about this....
If you have written queries named Qry1, Qry2, and Qry3...

Have a new button named Do_it_All_Button...

sub Do_it_All_Button_onclic
docmd.setwarnings fals
docmd.openquery("Qry1"), acviewnorma
docmd.openquery("Qry2"), acviewnorma
docmd.openquery("Qry3"), acviewnorma
docmd.setwarnings tru
end su

Either that, or have a macro called when you press the one button. The macro could contain these 3 queries

Tim
----- Will wrote: ----

Hi all

I have several queries that perform such steps as update
the records and extract only one field after that(that
output results to screen). I have buttoms designated to
each but I wonder if there is a way to combine both
queries under one buttom/click and do not output update
message prompt and query results to the screen, just to
perform operation in silence mode
Also need help with code to save the query results to a
specific location as txt file with no column heading..
Thanks a lot!!

Wil
 
To perform in 'silent mode' use:

DoCmd.SetWarnings False

Don't forget to set back to True at the end of your code and include a
proper Error Handler and single point of exit so that the warnings are
switched back on even if there is an error.

To output to a text file without a heading use a line like:

DoCmd.TransferText acExportDelim, , "tblTest", "C:\Export.txt", False

I think that you can specify a table or a query as the source to be output
and you can choose from various formats.

HTH

Paul
 
Back
Top