Results 1 to 7 of 7
  1. #1
    Join Date
    May 2004
    Posts
    37

    Question Unanswered: Count How Many Items Contain Certain Value

    Hi,

    I have a form which is used to add items to the test. Here are the fields on the forms:

    Item Question
    Possible Answers
    Correct Answer
    Case Text
    Level 1 Classification
    Level 2 Classification

    When the user adds an item to the test, how can I have the program count how many level 1 of certain value and how many level 2 of certain are currently on the test?

    Here's how I want it took look:

    Level 1

    Math 4


    Level 2

    Algebra 2
    Geometry 2


    If possible, I want this to be in a report.

    Do you understand what I am trying to do?


    Thank you!

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    Hmmm...well...I'm kind of confoosed. It may be an idea to provide (post) a sample db (with some data) to indicate exactly what you are trying to accomplish. I think a little more detailed explanation would be an asset as well. Hand in hand the two should provide some results.


  3. #3
    Join Date
    May 2004
    Posts
    37
    Here's in essence what I want to do:

    Say I have a text box with the following values in it:

    Math
    Science
    Math
    Reading
    Writing
    Science
    Math
    Math
    Writing


    I want to compute how many total Math Values there are, how many total Science Values there are, etc....

    So in this case, I want the finished product to look something like this:

    Math (4)
    Science (2)
    Reading (1)
    Writing (2)


    How can this be done?

    Thank you

  4. #4
    Join Date
    Feb 2004
    Location
    Wales
    Posts
    343
    MMM Im assuming that the

    Math
    Science
    Math
    Reading
    Writing
    Science
    Math
    Math
    Writing

    is in one record therefore a I smell a Crosstab query as the answer to this !

    regards

    gareth

  5. #5
    Join Date
    May 2004
    Posts
    37
    Well, its not really a record but rather just a text box with values in it. When an item is selected for the test, its Item Classification is transfered to a text box.

    Here's the code that I use:

    Code:
    txtTextBox=txtTextbox & vbcrlf & vbcrlf & txtItemClassification
    So the text box is just free standing and not linked to a table or a query.

  6. #6
    Join Date
    Nov 2003
    Posts
    1,487
    Ahhhhh...I see...Okay, Take a look at the attached sample. I have created some code that will do what you require. If you would like some explaination to the code then just let me know.


    Attached Files Attached Files

  7. #7
    Join Date
    May 2004
    Posts
    37

    Thumbs up

    That is exactly what I was looking for!

    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
  •