Allows anything to be entered in a numeric field

Discuss the database features

Allows anything to be entered in a numeric field

Postby JEROME549 » Wed Oct 17, 2018 11:00 pm

i have a very basic database with name, address, city, state and zip. i want base to reject anything but numbers in the zip field. i have the zip field set up as a numeric field,but i can enter text as well as numbers. what i want is for base to reject anything but numbers and tell user, numbers only in this field. thanks
OpenOffice Version 4.1.5 on Windows 10
JEROME549
 
Posts: 3
Joined: Fri Apr 06, 2018 6:06 pm

Re: allows anything to be entered in a numeric field

Postby UnklDonald418 » Thu Oct 18, 2018 4:49 pm

The first time you encounter a zip code with a leading zero, you will regret your choice of storing zip codes as a numeric data type. It is better to store zip codes and phone numbers as text.

On a Base form use a Pattern Field control for the zip code field. On the General tab of the Properties: Pattern Field dialog set Edit mask to NNNNNLNNNN, Literal mask to #####-#### and Strict format to Yes.
For more information on Pattern controls see the LO Base Handbook, available from
https://documentation.libreoffice.org/en/english-documentation/
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.5 & LibreOffice 6.1.1.2 - Windows 10 Professional
UnklDonald418
Volunteer
 
Posts: 968
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA


Return to Base

Who is online

Users browsing this forum: No registered users and 8 guests