Tezcatlipoca
Registered User.
- Local time
- Today, 20:53
- Joined
- Mar 13, 2003
- Messages
- 246
I have a table, tblLogs, which - as wella s the ID primary key - is comprised of 10 checkbox fields which represet a Subject.
When records are logged into the database, the user can selectively tick or untick any of these Subjects from the form, so that one record (thus one row in the table) may contain no ticks, one tick or many ticks.
I am trying to now write a statistics form, which will show - amongst other things - the most popular Subject(s). I'd prefer to code the entire thing in VB, but am happy to use a query if that's any easier.
I know, or rather think, the answer lies in either the Count or Sum functions within the query. I can write a test query and count up the number of ticks in a single column no problem, but I need 10 counted within the same query.
Once that's done, I then need to be able to pass the most numerous Subject (or Subjects if there is a tie) back to an unbound textbox on my form.
Does anyone have a neat way to accomplish this, or am I going to have to write 10 single-field count queries, embed them on the form, then do the calculation of the most popular from there?
When records are logged into the database, the user can selectively tick or untick any of these Subjects from the form, so that one record (thus one row in the table) may contain no ticks, one tick or many ticks.
I am trying to now write a statistics form, which will show - amongst other things - the most popular Subject(s). I'd prefer to code the entire thing in VB, but am happy to use a query if that's any easier.
I know, or rather think, the answer lies in either the Count or Sum functions within the query. I can write a test query and count up the number of ticks in a single column no problem, but I need 10 counted within the same query.
Once that's done, I then need to be able to pass the most numerous Subject (or Subjects if there is a tie) back to an unbound textbox on my form.
Does anyone have a neat way to accomplish this, or am I going to have to write 10 single-field count queries, embed them on the form, then do the calculation of the most popular from there?