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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to hide results of the intermediate queries in MS Access

Status
Not open for further replies.

blyssz

Technical User
Nov 18, 2008
49
US
Hello all,

I have a form and want to generate report.
I am using various SELECT queries to compute values. When I call these queries using docmd.openquery, then the intermediate results of SELECT query appears. I want them to be hidden from the user, since they are temp queries and should not be displayed to the user . I am using the form which available to the user to get the report and I want it be to visible always , while hide these queries from the user view as do the computation in the background.
How can I do that.

Thanks in advance,
Blyssz
 
This could probably be better accomplished by setting up a temporary table (not literally since Access doesn't support that per se). I mean create a table (as a cache) holding your precalc'd values and have your form's record source utilize the temporary table.

The only other approach I can see is writing functions to be called by your master query to produce the visible results that you need shown.

But, "hiding" sub queries is not something I would pursue. That would be best accomplished by creating data/or recordsets to store what you need. But, that requires code writing.

Gary
gwinn7
 
Not sure if this is what you mean, but...

If your main query refers to the 'subs' (ie: the subs are components of the query) they will run automatically when the 'master' is run.

For example:

SELECT qrySourceCost.strSourceCode, Sum(qrySourceCost.curIssueCost) AS YTDCost
FROM qrySourceCost
WHERE (((qrySourceCost.dtIssueDate) Between CVDate("1/1/" & Year([Forms]![frmExec]![subDynamic].[Form]![txtDate])) And eomonth([Forms]![frmExec]![subDynamic].[Form]![txtDate2])) AND ((qrySourceCost.strSourceCode) Not Like "ref" & "*"))
GROUP BY qrySourceCost.strSourceCode;

qrySourceCost (the runs automatically, providing the needed values to this query (and the report it's associated with) - never being seen.

Let them hate - so long as they fear... Lucius Accius
 
how about putting a subform on your form and assigning its record source to the query. You could turn off its visibility so it's not seen on the form.

Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top