Checkbox tally on Continuous Forms

R

robboll

I am looking for the best way to accomplish the following Continuous
Forms concept.

Given: There are Five Groups A, B, C, D, E

Each group has eight members: a, b, c, d, e, f, g, h

Each member is seen as a row in a continuous form like:

A a
A b
A c
..
..
..
A h
B a
B b
..
..
..

Each row (member) has a selection checkbox and a lable

The behavior that I am looking for is -- when you click on a checkbox
for any group, the count for that group is reflected in it's lable.

Using Group D as an example, if you check member D b (and it is the
only member of that group selected) then D b's lable shows "1" -- if
you then select member D g the label updates to "2" and so on until
your reach "4". If you de-select member D b it's label value
disappears and the value for Group D is refreshed with the total
number of checks for Group D.

When you exceed "4" the number briefly turns into a message like "All
4 Selected" and then back to a "4".

I was thinking of a function using dlookup that accomplishes this, but
I don't want to reinvent the wheel if there is a better method of
letting the user he's exceeded the count for each group.

Thanks for any suggestions,

RBolling
 
M

Mr. B

I am looking for the best way to accomplish the following Continuous
Forms concept.

Given: There are Five Groups A, B, C, D, E

Each group has eight members: a, b, c, d, e, f, g, h

Each member is seen as a row in a continuous form like:

A a
A b
A c
.
.
.
A h
B a
B b
.
.
.

Each row (member) has a selection checkbox and a lable

The behavior that I am looking for is -- when you click on a checkbox
for any group, the count for that group is reflected in it's lable.

Using Group D as an example, if you check member D b (and it is the
only member of that group selected) then D b's lable shows "1" -- if
you then select member D g the label updates to "2" and so on until
your reach "4". If you de-select member D b it's label value
disappears and the value for Group D is refreshed with the total
number of checks for Group D.

When you exceed "4" the number briefly turns into a message like "All
4 Selected" and then back to a "4".

I was thinking of a function using dlookup that accomplishes this, but
I don't want to reinvent the wheel if there is a better method of
letting the user he's exceeded the count for each group.

Thanks for any suggestions,

RBolling

I think that the answer to your questions depends on wheather or not
your group controls are bound or unbound.

If they are bound then using the DCount function might work. On the
other hand, you could declare a module level variable to hold a value
that you would then increment or decrement as the use makes
selections. You can then display the number from the variable or any
other info you need to show with it.

If you form always opens with default values for each of your group
controls then just starting with a zero value in the variable would
work, but if the form stores the values that are selected the you may
need to put some code in the On Current event of your form that will
check the values of all of the group controls and set that value to
the variable before users start to make selections.

HTH

Mr B
 
R

robboll

I think that the answer to your questions depends on wheather or not
your group controls are bound or unbound.

If they are bound then using the DCount function might work. On the
other hand, you could declare a module level variable to hold a value
that you would then increment or decrement as the use makes
selections. You can then display the number from the variable or any
other info you need to show with it.

If you form always opens with default values for each of your group
controls then just starting with a zero value in the variable would
work, but if the form stores the values that are selected the you may
need to put some code in the On Current event of your form that will
check the values of all of the group controls and set that value to
the variable before users start to make selections.

HTH

Mr B- Hide quoted text -

- Show quoted text -

Okay -- I give up. I was the one who brought up using DLookup as a
solution, but doesn't that just bring back one value based on another
value. If I did a dlookup on a State and Abbreviations table I'd
enter AZ and the DLookup result would bring back Arizona. How would
you use DLookup to count the number of members in one of the groups?
BTW these are bound fields.

Thanks

RBolling
 

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