Albert,

I did not see a PROPERTY to change the DBEdit field format. You might try
changing the Hint so it display the suggested zip format.

SWITCH (.vCountry)
CASE 'US'
        PROPERTY vci_ZipField HINT 'US Zip Code, please use 99999-9999
format'
        BREAK
CASE  'CA'
        PROPERTY vci_ZipField HINT 'Canada Zip Code, please use A9A 9A9
format'
        BREAK
DEFAULT
        PROPERTY vci_ZipField HINT 'Unknown Country  Zip Code, please use
99999-9999 format'
        BREAK
ENDSW

On the On Exit EEP you can check the zip code for validity.

A better option is to create two field for the zip code, one with Component
ID "vci_CA" with  the format set for the Canadian zip, and the other with
Component ID "vci_US" with the format set for the US zip.
Both fields are placed in the exact same position, i.e. one on top of the
other. On - entry to the form/exit from the country field/ entry to the zip
field - depending on form structure, you enable the one for the correct
country and disable the other one.

Javier,

Javier Valencia, PE
O: 913-829-0888
H: 913-397-9605
C: 913-915-3137
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Albert Berry
Sent: Monday, April 23, 2012 11:45 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - A challenge for you

Here is the challenge I have for you if your day is slow. I have a system I
am working on that is used in both USA and Canada. The parameters for the
challenge:

  * US zip codes are formatted *99999-9999*
  * Canadian Postal codes are formatted *A9A 9A9* -- the space is correct.
  * My trusty R:Docs 9.1 does not show an option for a dbedit to change
    the format of the field on entry so that I can look up the country
    associated with the entry and change the format to the country
    specific format.
  * I do not want to maintain two columns when one text 10 column will do.
  * Any geniuses out there that can figure this one out?

I already have a format checker in the exit eep that  catches most user
errors, but it would be nice to make the zip code field like the date and
phone fields where the user just types away and doesn't worry about capital
letters and spaces and hyphens.

I can happily live with the situation as is, but this is one of those "I'm
sure it can be done, but ..." situations.

Have fun!
Albert


Reply via email to