Adding criteria from a combobox to multiple crosstab queries

stlciao

New Member
Joined
Nov 10, 2002
Messages
5
I am having a problem adding criteria to a multiple queries using a combo-box on a form to enter two dates that I want to compare the data from each date.

I am importing about 50k to 60k rows of data each day that I want to calculate a variance with a prior day (sometimes the previous day, sometime a weekly variance or Monday versus Friday). I load the data into a table and then use three queries that separate the data into three segments [Segment1], [Segment2], [Segment3] and use a [Begin Date] and [End Date] from a combo-box on a form in the criteria to select the dates of the data I want to compare. Then I have four crosstab queries that are based on each Segment query. However, the crosstab queries will not run and I will get an error "The Microsoft Jet database does not recognize '[Forms]![Start Forms]![Begin Date] as a valid field name or expression." However, this combo-box address is only in the segment query criteria and is not in the crosstab query. The segment queries will run fine when ran individually.

Previously, I used >now()-8 as the criteria in the segment queries and the crosstab queries would run, however, it exported additional data to excel which I would manually have to delete.

Any possible solutions would be appreciated...
Thanx
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I know that Crosstab Queries are much pickier about accepting parameters than normal Select Queries. In Query Design, right-click, go to Parameters and then define the parameter there as well as in the Criteria section. I seem to remember that you should take your parameter out of the original Select Query that feeds this Crosstab and only have it in the Crosstab, but I'm not sure; it's been a few months since I encountered this problem.
 
Upvote 0

Forum statistics

Threads
1,221,517
Messages
6,160,264
Members
451,635
Latest member
nithchun

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top