Results 1 to 5 of 5

Thread: dCount question

  1. #1
    Join Date
    May 2006
    Posts
    8

    Unanswered: dCount question

    I have a database with questions where the user can respond

    • never
    • sometimes
    • usually
    • always


    How do I count how many have responded never, how many responded sometimes how many responded usually and so on? I created a query with the first field as a calculated field. Here is the criteria:

    Qlty of Sup1: DCount("[COMPANY]","tblquestionaire","[onea]=1 and [location]='" & Forms!Loc!cboLocation & "' ")

    As you can see I am using query by form. The form for this query has one field I am filtering by. I don't know how to add multiple fields to the criteria. I will have to let the user filter by Location, Division, Supervisor and a date range.

    I need help modifying the statement so that I can filter and count by multiple fields. Thank you!

  2. #2
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    Assuming your [onea] value represents the response and it's numeric then I can't see a problem with your statement - are you saying there is a problem? Are you asking how to include further criteria ? If so just continue the criteria bit as you have already done.

    Chris

  3. #3
    Join Date
    May 2006
    Posts
    8

    Question Help please

    Qlty of Sup1: DCount("[COMPANY]","tblquestionaire","[onea]=1 and [location]='" & Forms!Loc!cboLocation & "' ")

    I am using the query by form. The example above is asking for location only. I have two other forms that have three fields.

    location
    division
    supervisor

    My question is where do I add the other fields in the statement above? Can I add for example

    "& Forms!Loc!cboLocation &", "&Forms!Loc!cboDivision &", "&Forms!Loc!cboSupervisor&"' ")

    Thank you!

  4. #4
    Join Date
    Jul 2004
    Location
    Southampton, UK
    Posts
    368
    It's gonna look something like

    Code:
    Qlty of Sup1: DCount("[COMPANY]","tblquestionaire","[onea]=1 and [location]='" & Forms!Loc!cboLocation & "' and [DIVISION]='" &  Forms!Loc!cboDivision & "' and [SUPERVISOR]='" & Forms!Loc!cboSupervisor & "'")
    I think I've got that right but then I never get it right first time.

    hth
    Chris

  5. #5
    Join Date
    May 2006
    Posts
    8
    Thank you!

Posting Permissions

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