Convert string to number

J

JimS

Using CInt(cbPartNbr.Column(3)), I get an overflow. cbPartNbr.Column(3) is
not the bound column, and it's presented for some reason as a string. It's a
number, and often over 32,767. I don't know the limit for CInt(), but I can't
seem to find any other function that might convert to a long integer or a
floating-point to overcome the limit issue. Any ideas?
 
D

Douglas J. Steele

CLng will convert to a Long Integer (-2,147,483,648 to 2,147,483,647). CSng
will convert to a Single, CDbl will convert to a Double.
 
M

Marshall Barton

JimS said:
Using CInt(cbPartNbr.Column(3)), I get an overflow. cbPartNbr.Column(3) is
not the bound column, and it's presented for some reason as a string. It's a
number, and often over 32,767. I don't know the limit for CInt(), but I can't
seem to find any other function that might convert to a long integer or a
floating-point to overcome the limit issue. Any ideas?


Integers can only hold values up to 32,767. Use CLng
instead. There is a broad list of C... functions to convert
to any availalble datatype.
 
Top