Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520

    Unanswered: Select All cumalative

    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.

    CountyCode Contydesc
    101 Bob County
    201 Sue County

    Etc....

    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.

    Any ideas on how I would do this?

    Thanks
    Darasen

  2. #2
    Join Date
    Sep 2004
    Posts
    161
    You want to accumulate on which criteria?

  3. #3
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    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.


    Darasen

  4. #4
    Join Date
    Sep 2004
    Posts
    161
    May be you can find a help here :
    http://www.mvps.org/access/forms/frm0043.htm

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    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.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520

    Thanks

    Thanks Jepi and Teddy
    That does help.

    The query goes on to calculate the total number of fields. FYI.

    Darasen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •