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

Pass standard query Criteria to Crosstab...

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have a standard query and a crosstab query is based on the result of the standard query. The crosstab is displayed as a subform on a form for viewing purposes etc.

In the standard query is a date column and this is always changing so the user is asked to enter the date before the query gives the results (i.e. the appropraite colums have been edited so that it asks for the date as it opens).

The problem is that the crosstab query is obviously not being updated as the dates in the standard query are not fixed. So, the form which displays the crosstab query does not give any results.

I have tried using a text box in a form, passing the date from there to the query and then opening the form with the crosstab result but no joy.

Has anybody got any suggestions?

Thanks,

Marcus
 
My suggestion is to use "Make Table" query to create a tempoarary table "_temp", on which you build the crosstab query.
Assuming that your standard query is Query1 and the crosstable query is Query2.
Before open Query2, run the following code first in VB:
Docmd.runsql "select * into _temp from query1 where " & strDateCriteria
Then you will get the correct result when you open Query2.


Seaport

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top