Numbers only for text field values

  • Thread starter Thread starter Harold via AccessMonster.com
  • Start date Start date
H

Harold via AccessMonster.com

I have a field that is for street numbers. I have it set to text, because I
am not going to do calculations on it. I want users to only put in numbers.
How can I restrict users to only inputing numbers?

Thanks,
Harold
 
Don't get yourself "in a wad" when they "don't sort properly".
Also because you are storing text the file size will be larger than if you
store numbers (one byte for each character, rather than 4 bytes for a
number)

Because the 'numbers' are text they will sort as follows.

Number Street
10 Maple Street
101 Maple Street
10101 Maple Street
12 Maple Street

Ed Warren
 
Thank you all !

Lynn said:
Take the following 2 steps:

1. Set the KeyPreview property of your FORM to Yes
2. Add the following colde to the KeyPress event of your textbox control.

If KeyAscii < 48 Or KeyAscii > 57 Then
Beep
End If
I have a field that is for street numbers. I have it set to text, because
I
[quoted text clipped - 4 lines]
Thanks,
Harold
 
How will you handle numbers with a fraction? Not too common but possible:

423 1/2 Elm St

-LGC
 
Or numbers with a letter:

423B Elm Street

You may need to ditch the input mask and write VBA code to validate what
the users enter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top