Kerbouchard
IS-IT--Management
Hi guys,(Very novice at Foxpro)
This is the code I ended up using for a zip code validation check. But when it goes down the table it stops at the zip code and matches the city in that record. But in some cases a zip code has more than one city.
EX. 33146 Miami
33146 Coral Gables
So if it was validating Miami it comes up as a match. But if someone input Coral Gables in city it would come up as invalid because it stops at Miami.
DO CASE
CASE SEEK(ALLT(objsycust.txtarcust_city.Value),"a_zip","city"
AND ;
UPPER(objsycust.txtarcust_zip.value)=a_zip.zip
ll_result = .t.
CASE SEEK(ALLT(objsycust.txtarcust_zip.Value),"a_zip","zip"
AND ;
UPPER(objsycust.txtarcust_city.value)=a_zip.city
ll_result = .t.
OTHERWISE
=MESSAGEBOX("Zip Code or City is Incorrect.",0+48, ;
"Data Entry Error"
objsycust.txtarcust_city.setfocus()
ll_result = .f.
ENDCASE
How can I set it to accept that a zip code may be valid for more than one city?
Appreciate the help!
This is the code I ended up using for a zip code validation check. But when it goes down the table it stops at the zip code and matches the city in that record. But in some cases a zip code has more than one city.
EX. 33146 Miami
33146 Coral Gables
So if it was validating Miami it comes up as a match. But if someone input Coral Gables in city it would come up as invalid because it stops at Miami.
DO CASE
CASE SEEK(ALLT(objsycust.txtarcust_city.Value),"a_zip","city"
UPPER(objsycust.txtarcust_zip.value)=a_zip.zip
ll_result = .t.
CASE SEEK(ALLT(objsycust.txtarcust_zip.Value),"a_zip","zip"
UPPER(objsycust.txtarcust_city.value)=a_zip.city
ll_result = .t.
OTHERWISE
=MESSAGEBOX("Zip Code or City is Incorrect.",0+48, ;
"Data Entry Error"
objsycust.txtarcust_city.setfocus()
ll_result = .f.
ENDCASE
How can I set it to accept that a zip code may be valid for more than one city?
Appreciate the help!