Guest_imported
New member
- Jan 1, 1970
- 0
Hello,
I'm very new to vbscript (it's bee a while since i've worked with visual basic 5 also). Anyways. I've tried using the val function to change a string to an integer but it won't work! My strings are in the currency format. Here's some of my code...
'subroutine for changing a lable depending on what the
'user selects in the dropdown box.
Sub cmbScreen_Change()
Select Case Document.frmTTX.cmbScreen.Value
Case "V700 with 14.1'' XGA TFT LCD & Li-Ion Battery"
Document.frmTTX.lblScreen.Caption="$1,250.00"
' ...blah blah....
'Here I am trying to calculate the total cost.
'The Val function isn't working. HELP!
Sub cmdCalcSysComp_OnClick()
dim cost
cost = Val(Document.frmTTX.lblScreen.Caption)
Document.frmTTX.lblTotalSysComp.Caption=cost
End Sub
Is there another way to go about this?
I'm very new to vbscript (it's bee a while since i've worked with visual basic 5 also). Anyways. I've tried using the val function to change a string to an integer but it won't work! My strings are in the currency format. Here's some of my code...
'subroutine for changing a lable depending on what the
'user selects in the dropdown box.
Sub cmbScreen_Change()
Select Case Document.frmTTX.cmbScreen.Value
Case "V700 with 14.1'' XGA TFT LCD & Li-Ion Battery"
Document.frmTTX.lblScreen.Caption="$1,250.00"
' ...blah blah....
'Here I am trying to calculate the total cost.
'The Val function isn't working. HELP!
Sub cmdCalcSysComp_OnClick()
dim cost
cost = Val(Document.frmTTX.lblScreen.Caption)
Document.frmTTX.lblTotalSysComp.Caption=cost
End Sub
Is there another way to go about this?