I have an access 2000 database. In this database I have a Table (Stats)with records for multiple counties.
I have this query SELECT stats.[County Code], stats.[Client Last Name]
FROM [CountyCodes] INNER JOIN stats ON [CountyCodes].countycode = stats.[County Code]
WHERE ((([County Codes].countycode)=[forms]![Countyselect]![code]) AND ((stats.Date) Between [forms]![countyselect]![startdate] And [forms]![countyselect]![enddate]));
The forementioned Form [CountySelect] has the user select a county from a Combo Box linked to a table named CountyCodes (original I know)
The CountyCodes Table is set up like this.
101 Bob County
201 Sue County
This works perfectly for selecting a single county and quering tha data.
I want to add an option to the combo box that will tell the query to query ALL the counties giving me a cumaltive report.
I need an option in the combo box that selects all the counties. so that ALL the records are selected as opsed to just the ones for a single county. I know I could write a sperate Query (obviously) but for my UI's sake I'd like the option from the combo box.
What do you do with the query after it executes? Does it get dumped into a report, form, displayed directly to the user?
I would either attack this with vba, or use seperate queries. Provided the date range would still always be provided, one work around would be to cast the keys to a string, use LIKE instead of =, and then plug in the * character when you need to pull all counties.