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

VBScript Problem

Status
Not open for further replies.

1Data

MIS
Sep 30, 2005
66
US
I am making a call to a VBScript called Validate. There is a Function within this script that is call validateNumeric(strValue). I keep getting a Type mismatch: 'validateNumeric'

here is my code..

If Form.purchaseprice1.value = "" Then 'If Null then Nothing Else Check
Else
Dim strValue
strValue = (Form.purchaseprice1.value)
intcheck = Sgn(Form.purchaseprice1.value)'Checking that Num is Positive
If intcheck = 1 Then
Dim intValue
intValue =(Form.purchaseprice1.value) 'Checking Length
msgBox intValue
If validateNumeric(intValue) Then
msgBox "Yes Boyeeee!"
End If
End If
End If

And here is my function...

function validateNumeric(strValue )
Set re = New RegExp
With re
'.Pattern = "(^-?\d\d*$)(\d{10})\.\d{1,2}$)"
.Pattern = "\d{10}"
.IgnoreCase = True
.Global = True
End With
'Boolean expressionmatch
expressionmatch = re.Test(strValue)
validateNumeric = expressionmatch
end function

If anyone can offer some advice i would appreciate it...It's not that value strValue being passed I know that to be a fact..I think it's the way I am calling the function which I have done before but now it is erroring out...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top