View Single Post
Old 11-12-03, 11:20 AM   #9 (permalink)
exbox
Aximsite Prospect
 
Join Date: Nov 2003
Posts: 3
Thanked 0 Times in 0 Posts
I am calling the funciton below. When I use it I get an error about using the 'Mid' function. This code should run just fine. I have tried it in both a form and a module.

Public Function ChkQty(vQty As String) As Boolean
Dim X As Long
Dim sQty As String


'validate a numeric value

For X = 0 To Len(vQty) - 1

sQty = Mid(vQty, X, 1)

If Asc(vQty) >= 48 And Asc(vQty) <= 57 Then
'no alpha characters
Else
MsgBox "QTY can contain numeric values only!", vbInformation, "Remote Invoice"
ChkQty = False
Exit Function
End If

Next X


ChkQty = True

End Function
exbox is offline   Reply With Quote