Need longer then 9 digits in Number type field

maxxximaniac

Registered User.
Local time
Today, 01:03
Joined
Oct 22, 2004
Messages
80
I need a field to permit only numbers. Upon selecting number for the data type I select Long Integer for a longer number... But it only allows 9 digits.. I need it to allow to enter in longer numbers... Any help?
Thank you very much in avdance
 
Long can store a value between -2,147,483,648 and 2,147,483,647

maybe double? it can hold values between -1.797E308 to -4.940E-324,0,4.940E-324 to 1.797E308.

not sure at what point (if at all) you have to switch to scientific notation with that..... but it allows up to 308 digits.
 
Do you plan on doing calculations with the numbers or, for example, are they credit card numbers?
 
thats the thing... i dont want it to display in scientific notation or decimals
becuase this will be used to user end querying and scientific notation would be beyond some of them...
 
SJ McAbney said:
Do you plan on doing calculations with the numbers or, for example, are they credit card numbers?

no calculations...
this field is for input of check numbers... so this will range anywhere from 1 digit to about 12 digits..
 
Then just use a Text field - you can ensure only numbers in the control's KeyPress event on a form.
 
Code:
Private Sub MyTextBox_KeyPress(KeyAscii As Integer)
   If KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
End Sub
 
I wouldn't use the keypress event to check each character, I would use the IsNumeric() function in the control's BeforeUpdate event.
 

Users who are viewing this thread

Back
Top Bottom