467,877 Members | 1,130 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

Continuous Forms Tally on Checkboxes

I am looking for the best way to accomplish the following continuous
forms concept.

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 bound checkbox and a lable: lblCounter

The behavior that I am looking for is -- when you click the checkbox
for any group, the count for that group is reflected in lblCounter.

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

If you exceed "4" checks for a group the number should briefly turns
into a message like "All
4 Selected" and then undo the check.

I have a feeling that as simple as this sounds this is difficult task
with continuous forms.

Thanks for any suggestions,
RBolling

Jul 13 '07 #1
  • viewed: 2925
Share:
1 Reply
On Fri, 13 Jul 2007 08:17:46 -0700, rpboll <RP****@gmail.comwrote:
>I am looking for the best way to accomplish the following continuous
forms concept.

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 bound checkbox and a lable: lblCounter

The behavior that I am looking for is -- when you click the checkbox
for any group, the count for that group is reflected in lblCounter.

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

If you exceed "4" checks for a group the number should briefly turns
into a message like "All
4 Selected" and then undo the check.

I have a feeling that as simple as this sounds this is difficult task
with continuous forms.

Thanks for any suggestions,
RBolling
Get the count from the underlying table rather than from the continuous form's
recordsetclone. Something like -

Sub CheckBoxControl_AfterUpdate()
Dim intChecked As Integer
Dim strGroup As String

Me.Dirty = False
strGroup = Me.Group
intChecked = Abs(DSum("CheckBoxField","tblMyTable","[Group]=" & Chr(34) &
strGroup & Chr(34)))

If intChecked >4 Then
Beep
MsgBox "All 4 Selected", vbInformation + vbOkOnly
Me.CheckBox = False
Me.Dirty = False
intChecked = intChecked - 1
End If

Me.lblCounter.Caption = intChecked

End Sub

Wayne Gillespie
Gosford NSW Australia
Jul 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark Hannon | last post: by
reply views Thread by Karl Roes | last post: by
2 posts views Thread by panwala_bhavesh | last post: by
1 post views Thread by blueheelers | last post: by
1 post views Thread by Hypnotik | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.