Counter: multi-field depend

S

Steve Scheckel

Hello there, I'm a rookie at this newsgroup thing and I'm
needing some help. I need to develop a counter that
counts based upon the input of three fields and yields
the result in the forth field: Course Name, Course Date,
Course Time. Last field would be the counter. (e.g.,
Class A, on 1 July 03, @ 1400 hours = number registered)
I should be able to answer the question: "How many
students do I have registered for "Class A" on 1 July 03
at 1400 hours.

I realize that this is easily accomplished in reports;
however, our data entry person needs this counter on a
pop-up form; so, that he can track the counter as he
makes entries.

Thanks for any help w/ this.
 
J

John Vinson

I need to develop a counter that
counts based upon the input of three fields and yields
the result in the forth field: Course Name, Course Date,
Course Time. Last field would be the counter. (e.g.,
Class A, on 1 July 03, @ 1400 hours = number registered)
I should be able to answer the question: "How many
students do I have registered for "Class A" on 1 July 03
at 1400 hours.

This "counter" should NOT exist in your table. THere are a couple of
ways to get this number - a Totals query based on your table is one.
Create a Query based on the table; make it a Totals query by clicking
on the Greek Sigma icon (like a sideways W). Group By the three fields
and add * as the fourth field (just type an asterisk) and set its
aggregate function to Count.

To just display the count on a Form, you can use the DCount function
instead: set the Control Source of a textbox to

=DCount("*", "[yourtablename]", "[Course Name] = '" & txtCourseName &
"' AND [Course Date] = #" & txtCourseDate & "# AND [Course Time] = #"
& txtCourseTime & "#")

where txtCourseName, txtCOurseDate and txtCourseTime are the names of
the form controls containing those fields.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top