Input mask on my report!

J

JOM

my field on my report has the zipcode input mask, such that one enters the
zipcode as 12345-6789 but if 6789 was not entered, I would like the report to
just have 12345 and not 12345- What would I do to get rid of the -
 
A

Al Camp

JOM,
Create a text control on your report called txtZipCode, and
give it this ControlSource... (assuming the "-" is stored with the zipcode)

=IIF(Len(ZipCode) = 10, ZipCode, Left(ZipCode,5))

(never name a calculated field the name of a legitimate field... hence
txtZipCode, not ZipCode)
 
F

fredg

my field on my report has the zipcode input mask, such that one enters the
zipcode as 12345-6789 but if 6789 was not entered, I would like the report to
just have 12345 and not 12345- What would I do to get rid of the -

Using an Unbound text control:

=IIf (Len([ZIP])>=9,Left([ZIP],5) & "-" &
Right([ZIP],4),Left([ZIP],5))

12345 or 12345- will print 12345
123456789 or 12345-6789 will print 12345-6789
 
J

JOM

Thanks alot that worked

Al Camp said:
JOM,
Create a text control on your report called txtZipCode, and
give it this ControlSource... (assuming the "-" is stored with the zipcode)

=IIF(Len(ZipCode) = 10, ZipCode, Left(ZipCode,5))

(never name a calculated field the name of a legitimate field... hence
txtZipCode, not ZipCode)
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 
J

JOM

Thanks alot that worked

fredg said:
my field on my report has the zipcode input mask, such that one enters the
zipcode as 12345-6789 but if 6789 was not entered, I would like the report to
just have 12345 and not 12345- What would I do to get rid of the -

Using an Unbound text control:

=IIf (Len([ZIP])>=9,Left([ZIP],5) & "-" &
Right([ZIP],4),Left([ZIP],5))

12345 or 12345- will print 12345
123456789 or 12345-6789 will print 12345-6789
 

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