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
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