View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Failing to capture values correctly? - CORRECTION

Well, maybe not, if you are not using decimal places in your values.

"Risky Dave" wrote:

Ooops!

Apologies, the the actual codeis this. The error is the same:

Sub BAUCostCheck()
Dim lCostScore As Long ' used to capture the assessed cost score
Dim lCostEst As Long ' used to capture the estimated cost

lCostScore = CLng(FmRiskCost.TextBox16.Value)
lCostEst = CLng(FmRiskCost.TextBox17.Value)

Select Case True
Case lCostScore = "1"
<do stuff
Case lCostScore = "2"
<do stuff
Case lCostScore = "3"
If lCostEst < 50000 or lCostEst 100000 Then
MsgBox "Medium cost must be between £50,000 and £100,000",
vbExclamation, "Cost Estimation Error"
FmRiskCost.TextBox19.Value = ""
FmRiskCost.TextBox22.Value = ""
FmRiskCost.TextBox24.Value = ""
FmRiskCost.TextBox25.Value = ""
FmRiskCost.TextBox26.Value = ""
End If
Case lCostScore ="4"
.
.
.
End Select
End Sub


"Risky Dave" wrote:


<snip
TIA

Dave