trying to limit text

  • Thread starter Thread starter francisco
  • Start date Start date
F

francisco

I want to limit a text data type to only recieve numbers.
Is this possible?
And if I try using the number data type, how can I limit
it to only 4 spaces.

Thanks in advance
 
I want to limit a text data type to only recieve numbers.
Is this possible?

Sure. Use an Input Mask of

0000

(all zeros); the user will be required to type four numeric digits and
no other characters will be accepted.

Use

9999

if you want them to be able to type zero to four digits. Note that the
text string will be LEFT justified and may not sort numerically if you
do this.
 
Under the input mask of the control, key in 9999
it should work

May
MCP in Access and SQL Server
 
or Try the following code under keypress event
If KeyAscii >= 48 And KeyAscii <= 57 Then
MsgBox "yes" ' do your work here
Else
KeyAscii = 0
End If

May
MCP in Access and SQL Server
 
Back
Top