A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Check Boxes on Forms



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2006, 04:55 PM posted to microsoft.public.access.forms
TAWise
external usenet poster
 
Posts: 39
Default Check Boxes on Forms

Is there a way to count the number of "yes" selections that are made on one
form. This form contains ~50 survey-type questions regarding
skills/knowledge in a particular category (i.e., one form is "Events
Coordination". "Events Coordination has about 8 subgroups such as
"Websites", "Budget", etc. There are questions under each subgroup such as
under "Websites"...."work with web developers", design webpage", etc.
.....but all of these checkmarks need to be tallied under the main category of
"Events Coordination" and they want the tally to be displayed directly on the
form and the checkmarks are clicked. I know how to =Count of a report but I
am baffled as to how to count these ~50 items immediately onto the form.
Thanx.
  #2  
Old August 30th, 2006, 06:06 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Check Boxes on Forms

You can loop through all the controls on your form looking for check boxes.
Use the ABS function so the -1 that represents Checked (True) will be
conterted to 1 to count the number checked. If there are any check boxes on
your form that should not be included, then you will need to add logic to
exclude that check box. The second example shows that.

Include All check boxes

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin
------------------------------------------

Exclude A Check Box named chkDummy

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox And ctl.Name "ctlDummy" Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin

"TAWise" wrote:

Is there a way to count the number of "yes" selections that are made on one
form. This form contains ~50 survey-type questions regarding
skills/knowledge in a particular category (i.e., one form is "Events
Coordination". "Events Coordination has about 8 subgroups such as
"Websites", "Budget", etc. There are questions under each subgroup such as
under "Websites"...."work with web developers", design webpage", etc.
....but all of these checkmarks need to be tallied under the main category of
"Events Coordination" and they want the tally to be displayed directly on the
form and the checkmarks are clicked. I know how to =Count of a report but I
am baffled as to how to count these ~50 items immediately onto the form.
Thanx.

  #3  
Old August 30th, 2006, 06:11 PM posted to microsoft.public.access.forms
TAWise
external usenet poster
 
Posts: 39
Default Check Boxes on Forms

Sounds like a nighmare but I will give it a whirl. Thank you for your quick
response.

"Klatuu" wrote:

You can loop through all the controls on your form looking for check boxes.
Use the ABS function so the -1 that represents Checked (True) will be
conterted to 1 to count the number checked. If there are any check boxes on
your form that should not be included, then you will need to add logic to
exclude that check box. The second example shows that.

Include All check boxes

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin
------------------------------------------

Exclude A Check Box named chkDummy

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox And ctl.Name "ctlDummy" Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin

"TAWise" wrote:

Is there a way to count the number of "yes" selections that are made on one
form. This form contains ~50 survey-type questions regarding
skills/knowledge in a particular category (i.e., one form is "Events
Coordination". "Events Coordination has about 8 subgroups such as
"Websites", "Budget", etc. There are questions under each subgroup such as
under "Websites"...."work with web developers", design webpage", etc.
....but all of these checkmarks need to be tallied under the main category of
"Events Coordination" and they want the tally to be displayed directly on the
form and the checkmarks are clicked. I know how to =Count of a report but I
am baffled as to how to count these ~50 items immediately onto the form.
Thanx.

  #4  
Old August 30th, 2006, 08:04 PM posted to microsoft.public.access.forms
TAWise
external usenet poster
 
Posts: 39
Default Check Boxes on Forms

Is there any way to show the value in real time as the checkboxes are being
clicked rather than having to close the form and re-opening it?

Thanx again

"TAWise" wrote:

Sounds like a nighmare but I will give it a whirl. Thank you for your quick
response.

"Klatuu" wrote:

You can loop through all the controls on your form looking for check boxes.
Use the ABS function so the -1 that represents Checked (True) will be
conterted to 1 to count the number checked. If there are any check boxes on
your form that should not be included, then you will need to add logic to
exclude that check box. The second example shows that.

Include All check boxes

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin
------------------------------------------

Exclude A Check Box named chkDummy

Function CheckTotals() As Long
Dim lngSumTot As Long
Dim ctls As Controls
Dim ctl as Control

For Each ctl In Me.ctls
If ctl.ControlType = acCkeckbox And ctl.Name "ctlDummy" Then
lngSumTot = lngSumTot + ABS(ctl)
End If
Next
Set ctls = Nothing
Set ctl = Nothing
CheckTotals = lngSumTot
End Functioin

"TAWise" wrote:

Is there a way to count the number of "yes" selections that are made on one
form. This form contains ~50 survey-type questions regarding
skills/knowledge in a particular category (i.e., one form is "Events
Coordination". "Events Coordination has about 8 subgroups such as
"Websites", "Budget", etc. There are questions under each subgroup such as
under "Websites"...."work with web developers", design webpage", etc.
....but all of these checkmarks need to be tallied under the main category of
"Events Coordination" and they want the tally to be displayed directly on the
form and the checkmarks are clicked. I know how to =Count of a report but I
am baffled as to how to count these ~50 items immediately onto the form.
Thanx.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:00 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.