Results 1 to 7 of 7
  1. #1
    Lettyg82 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    18

    Parameter Query/Report Question to Count Text

    I need to count the number of Female Defendants and number of Male Victims in a parameter query. The fields [DefSex] and [VSex] are text fields from a lookup column where F is female and M is Male. This report will be specific by date and specialist. I want the specialist, Kati Behrens (in the query the criteria for the field [Specialist] is set to Kati Behrens) to be able to pull up all of her cases from 08/01/12 (which is a parameter in the query).
    In the query I created a field for [DefSex] which is FDEF: IIf([defsex]="F",1,0) and one for [VSex] which reads as VMALE: IIf([VSEX]="M",1,0)
    In the report I put a text box that reads =sum([FDEF] and another =([Vsex])


    However this gives me an error when I put it on the report footer. If i place these boxes in the detail section is calculates but it calculates depending on many Charges there are, if one case has 3 charges it counts 3 female defendants.
    How can I get this field to count only once?
    I can send snapshots of my report and query. Please help, I am new to access and am seriously confused. I am open to any suggestions.
    Thanks
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    One option is to use DCount in textbox ControlSource. The DCount would need the same criteria as in the query the report is based on.

    DCount("*","Cases","DefSex='F' AND Specialist='Kati Behrens' AND CaseDate=#[Enter Date]#")

    I don't use query input popup parameters. I use reference to form controls where criteria are input.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Lettyg82 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    18
    That doesn't seem to work either. It still gives me an error message. I put the code you provided in a text box on the page footer and its just gives me an error.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I would have to examine database. If you want to provide, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Lettyg82 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    18
    Here you go. I am having problems with the rptDismissedCases and LongSheetRPT, specifically having to do with the sum of things.
    Attached Files Attached Files

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Getting the table name correct helped. I couldn't read it from you snapshot image.

    =DCount("*","Case","Dismissed = True AND DefSex='F' AND Specialist='Kati Behrens' AND CaseDate BETWEEN #" & [StartDate] & "# AND #" & [EndDate] & "#")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Lettyg82 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    18
    Thank you so much, that fixed it!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Count occurences of text in a query
    By funkygoorilla in forum Queries
    Replies: 5
    Last Post: 02-12-2012, 09:14 PM
  2. Parameter Query to report
    By kathi2005 in forum Reports
    Replies: 7
    Last Post: 11-02-2011, 02:00 PM
  3. a Question about Free text in a report.
    By fedesc in forum Access
    Replies: 3
    Last Post: 10-26-2011, 11:31 AM
  4. Count and crieria on Report question
    By AndycompanyZ in forum Reports
    Replies: 7
    Last Post: 08-10-2011, 06:54 AM
  5. Replies: 5
    Last Post: 08-05-2009, 12:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums