Limit text box to numeric entries

J

Joe M.

I would like to limit a text box to numeric (0-9) entries. Also I would like
to limit the number of charactors entered. I think I can use the keypress
event but can't make my code work. Can someone supply some sample code?

Thanks,
Joe M.
 
B

Bob Quintal

I would like to limit a text box to numeric (0-9) entries. Also I
would like to limit the number of charactors entered. I think I
can use the keypress event but can't make my code work. Can
someone supply some sample code?

Thanks,
Joe M.

You don't need any code, just use an input mask
From the help file
0 Digit (0 to 9, entry required, plus [+] and minus [–] signs not
allowed).
9 Digit or space (entry not required, plus and minus signs not
allowed).
# Digit or space (entry not required; spaces are displayed as
blanks while in Edit mode, but blanks are removed when data is saved;
plus and minus signs allowed).
 

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

Top