Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Make TextBox ActiveX Ctrl Count Selected CheckBox ActiveX 1

Status
Not open for further replies.

dddivers

Instructor
Dec 4, 2001
30
US
Is there anyone who knows how to make a TextBox activeX control tally when folks select certain CheckBox controls (in a MS WORD 2000 form).

I've tried a few different IF THEN ELSE Statements directly in the Textbox control and in VBA, but I'm hitting a wall! I think my code and/or Properties settings must be incomplete but I can't figure out what I'm missing.

THANK YOU - ddd
 
I am not sure if I am understanding the question correctly but if you make your checkboxes a control array (named chkArr) you could use something like this:

Private Sub chkArr_Click(Index As Integer)
Dim chk As CheckBox
Dim iX As Long

For Each chk In chkArr
If chk.Value = vbChecked Then
iX = iX + 1
End If
Next 'chk
Text1.Text = CStr(iX)
End Sub

Hope this helps. If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
The second set of code you sent me was perfect. Thank you!
 
[peace] If you choose to battle wits with the witless be prepared to lose.
[machinegun][hammer]

[cheers]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top