Results 1 to 15 of 15
  1. #1
    Join Date
    Sep 2007
    Posts
    13

    Unanswered: Putting a counter on a form

    Hello everyone. I am in charge of a student sign in sign out database at the college where I work. This database has two forms and one table. What I would like to do is include a text box on the first form, which is the sign in form that will display a running total of the students that are signed in. This text box should count 1, 2, 3 etc. each time a student clicks the sign in button. I have uploaded the database so you can look at it if need be. Thanks for the help
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Hey again Frankl...
    If you're using listboxes (like the example I uploaded for you a while back) there's actually a lovely property of a listbox called .ListCount which sounds like it'd be perfect for your need here.
    George
    Home | Blog

  3. #3
    Join Date
    Sep 2007
    Posts
    13
    Im sorry georgev I dont mean to sound dense but how would I go about accessing that property. Thanks

  4. #4
    Join Date
    Sep 2007
    Posts
    13
    Acctually thats wrong. Sorry my fault. I need to display a running count on the first form, of all the Stundent IDs that are currently in the table.

  5. #5
    Join Date
    Sep 2007
    Posts
    13
    Never mind got it! Attached a list box to a query. Thanks for the help.

  6. #6
    Join Date
    Sep 2007
    Posts
    13
    Okay heres is the statement that I have used, but I need to refine it to display only those IDs for the current date, any ideas? thanks

    SELECT Count([StudID]) AS [Count]
    FROM StudentTable;

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Have you thought about using a WHERE clause?
    It may be worth noting a few other functions such as Year(), Month(), Day() and Now().
    George
    Home | Blog

  8. #8
    Join Date
    Sep 2007
    Posts
    13
    Well heres what I tried but I get the error "cannot have aggregate function in where clause".

    SELECT Count([StudID]) AS [Count]
    FROM StudentTable
    WHERE (((Count([StudID]))=Now()));

  9. #9
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Where the count of all your records equals todays date?
    Well, that's not going to work now is it!
    Quote Originally Posted by frankl
    display only those IDs for the current date
    What field are you wanting to compare with the current date?
    George
    Home | Blog

  10. #10
    Join Date
    Sep 2007
    Posts
    13
    The StudID field.

  11. #11
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Is the StudID a date (or datetime) field?
    George
    Home | Blog

  12. #12
    Join Date
    Sep 2007
    Posts
    13
    The StudID field is a field that generates an auto number ID for each student

  13. #13
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by frankl
    display only those IDs for the current date,
    So how do you know what date StudID is..?

    The only way to achieve what you are asking is to add a new field to the table which records the date when the record was created. Otherwise we're asking questions which the data cannot answer!
    George
    Home | Blog

  14. #14
    Join Date
    Sep 2007
    Posts
    13
    The table does have a date field

  15. #15
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    So I repeat
    Quote Originally Posted by georgev
    What field are you wanting to compare with the current date?
    Why don't you tell everyone about your table design. Try include all field names and datatypes. Then try and rethink your question and post that too
    George
    Home | Blog

Posting Permissions

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