How do I Hide the results of my Access Query?

J

JrMonteCarlo24

I have several queries in Access that I have to run to populate a some tables
and I don't want the users to see the result of each query that is run. I
would like the user to click a button to run the queries and just get the
final results not the results to the previous 4 queries.
 
D

Duane Hookom

What "results" are they seeing? Are they seeing the warning dialogs? If so,
use
DoCmd.SetWarnings False
and
DoCmd.SetWarnings True
 
R

Rick Brandt

JrMonteCarlo24 said:
They are seeing the results in the Datasheet view.

Actions queries are executed. There is no reason to "open" them in datasheet
view to get them to work.

What does your button code look like?
 
J

JrMonteCarlo24

DoCmd.SetWarnings False

stDocName = "JantoDec"
DoCmd.OpenQuery stDocName, acViewNormal, acReadOnly

stDocName2 = "CurrentPeriod"
DoCmd.OpenQuery stDocName2, acViewNormal, acReadOnly

stDocName3 = "OneThruPriorPeriod"
DoCmd.OpenQuery stDocName3, acViewNormal, acReadOnly

stDocName4 = "ContractChanges"
DoCmd.OpenQuery stDocName4, acViewNormal, acReadOnly
 
D

Duane Hookom

Are these queries Action or Select queries? Maybe you could provide the SQL
view of one or more of these.
 
G

Gina Whipp

Try:

DoCmd.SetWarnings False
DoCmd.OpenQuery "JantoDec"
DoCmd.OpenQuery "CurrentPeriod"
DoCmd.OpenQuery "OneThruPriorPeriod"
DoCmd.OpenQuery "ContractChanges"
DoCmd.SetWarnings True

Queries SHOULD run in the background without opening...
 
Top