Larry - Thanks for solving the conundrum. The property is EDITMASK
rather than EDTMASK, but that was a no brainer.
Alastair and Javier - thanks for the hints. The responses are lightning
quick in this list.
Here is the eep, the content of my countries table, made new for this.
I did have to use the literal space (CHAR(160)) rather than the
underscore when I put it into the table for Canadian postal codes, as
pulling from the table the underscore became a literal character rather
than a space filler and when I changed the second field to 0 the
underscore disappeared and left no space.
Thanks again! This list is wonderful.
Albert
Table: States No Lock(s)
No. Column Name Attributes
--- -------------------- ---------------------------------
1 State Type : TEXT 2 NOT NULL
Consrnt: PRIMARY KEY REFERENCED
2 StateName Type : TEXT 30 NOT NULL
Consrnt: UNIQUE
3 Country Type : TEXT 24 NOT NULL
Current number of rows: 64
The contents of Countries
Country PostCodeFormat
------------------------ --------------------
Canada >L9L 9L9;1;_
Mexico 99999;0;_
United States of America 99999_9999;0;_
SET VAR fContactZip TEXT
SET VAR fContactState TEXT
SET VAR fContactCountry TEXT
GETPROPERTY cContactState TEXTVALUE "fContactState"
IF fContactState IS NULL THEN
GOTO Stop
ENDIF
SELECT PostCodeformat INTO fPostCodeFormat i1 FROM Countries, States +
WHERE State = .fContactState AND Countries.Country = States.Country
PROPERTY cContactZip EditMask .fPostCodeFormat
LABEL Stop
RETURN
On 23/04/2012 10:57 AM, Lawrence Lustig wrote:
<<
* 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.
>>
The property is EdtMask.
<<
* I do not want to maintain two columns when one text 10 column will do.
>>
An alternative is to maintain two db edits on the form, attached to
the same column, and set the VISIBLE flag depending on the country so
the users sees the correctly formatted version.
--
Larry
No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2012.0.2127 / Virus Database: 2411/4954 - Release Date: 04/23/12