Does anyone know what the constant adNumeric is equal to in Visual Basic?
Printable View
Does anyone know what the constant adNumeric is equal to in Visual Basic?
Is this to identify if an items is numeric or not?
If so,
Hope this is of use…Code:If IsNumeric(Text1.text) Then
MsgBox “Numeric”
Else
Msgbox “Not Numeric”
End If
It's easy to find out what any constant is:
Open up the debug window (Ctrl+G)
type the following:
? adNumeric
or any other constant. If you need the data type of a constant, type:
? VarType(adNumeric)
Most of them are, obviously, long, but it doesn't hurt to check.
(btw: look up VarType in the help file to see what the number it returns means. I think 3 means long but not sure...)
Actually the reason I needed to know that was a function I am debugging is passing a parameter as a double into a method then calling a function that makes the parameter list for a store procedure passing the double.
Example:
mp(ByVal PName As String, ByVal PType As ADODB.DataTypeEnum, ByVal PSize As Integer, ByVal PValue As Variant)
The type specified for ADODB.DataTypeEnum was adNumeric which is giving a Type Mismatch error.
I changed it to adDouble and that appears to be working.