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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Verifying Checkboxes

Status
Not open for further replies.

xstar9x

Programmer
Mar 25, 2002
6
CA
I'm trying to program a notebook configurator. What it does is uses comboboxes to select the different diplay sizes, hard drive, memory, blah blah. Then I'm using checkboxes to so they can just check off the options they would like. I'm using a button named 'Calculate Options' to calculate the corresponding option lables of the checked checkboxes.

How do you verify which checkbox is checked? (here's my code so far below...) It just calculated everything no matter what!

Sub cmdCalcOPT_OnClick()
Dim totalOPT
Dim dimm128, dimm256, nb7li 'blah...

dimm128=0
dimm256=0
nb7li=0 'blah blah....

If (Document.frmOPT.chkDIMM128.Value="yes") Then
dimm128=(CCur(Document.frmOPT.lblDIMM128.Caption ) )
End If
If (Document.frmOPT.chkDIMM256.Value="yes") Then
dimm256=(CCur(Document.frmOPT.lblDIMM256.Caption))
End If
If (Document.frmOPT.chkNB7Li.Value="yes") Then
nb7li=(CCur(Document.frmOPT.lblNB7Li.Caption))
End If
'blah blah blah....

totalOPT=dimm128 + dimm256 + nb7li + 'blah blah blah...

Document.frmOPT.lblTotalOPT.Caption=(FormatNumber(totalOPT))

End Sub
 
You need to verify the checked property, not the value of the checkboxes:

If (Document.frmOPT.chkDIMM128.checked) Then

etc.
 
I'm always making things harder for myself then they are!

Thanx a BUNCH!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top