Re: Continuous Forms Group Selection Counter
- From: rpboll <RPBOLL@xxxxxxxxx>
- Date: Fri, 13 Jul 2007 20:59:18 -0700
On Jul 13, 12:12 pm, Marshall Barton <marshbar...@xxxxxxxxxx> wrote:
rpboll wrote:
I am looking for the best way to accomplish the following Continuous
(bound) 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 trying to accois -- 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".
You can use a text box for the label. Set the text box's
control source expression to:
=DCount("*","table","check AND Group = '" & Group & "'")
Use the check box's AfterUpdate event to see if too many are
checked:
If checkboxcontrol And DCount("*","table", _
"check AND group = '" & group & "'")=4 Then
MsgBox "Too many"
checkboxcontrol = False
End If
While that may do at least most of what you asked for, I
don't think it will be very practical. The DCount
expression will be evaluated frequetly and you will probably
cause significant hesitations in the form's behavior.
--
Marsh
MVP [MS Access]- Hide quoted text -
- Show quoted text -
Thanks! This works well. I am using a conditional format ILO the
after update check to avoid the hesitations you alluded to. For an
imediate though it needs a forms.requery. Unfortunately this causes
the control to loose focus. Do you know of a way to keep focus on the
updated checkbox when updating the control and using forms.requery?
This is a pretty awsome method.
RBolling
.
- References:
- Continuous Forms Group Selection Counter
- From: rpboll
- Re: Continuous Forms Group Selection Counter
- From: Marshall Barton
- Continuous Forms Group Selection Counter
- Prev by Date: Can't find syntax to reference recordset values
- Next by Date: Re: Suppress "You are about to delete... " message?
- Previous by thread: Re: Continuous Forms Group Selection Counter
- Next by thread: TreeView Control
- Index(es):
Relevant Pages
|