473,396 Members | 1,935 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Formatting a Zip Code

I have Access 2000. I made a mailing list database and for the life of
me can't remember how to format the zip code field so it will print on
the label as xxxxx-xxxx. I have tried various - 9, #, 0 - options but
the "-" is not printing. It is running the numbers together.

What am I doing wrong?

I am using the label wizard and have the table set with zip code as a
separate field.

Thanks

Oct 2 '06 #1
5 15892
00000\-9999;0;
hth

William Hindman

"Carla" <br******@gilanet.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>I have Access 2000. I made a mailing list database and for the life of
me can't remember how to format the zip code field so it will print on
the label as xxxxx-xxxx. I have tried various - 9, #, 0 - options but
the "-" is not printing. It is running the numbers together.

What am I doing wrong?

I am using the label wizard and have the table set with zip code as a
separate field.

Thanks

Oct 2 '06 #2
On Mon, 2 Oct 2006 14:26:55 -0400, William Hindman wrote:
00000\-9999;0;
hth

William Hindman

"Carla" <br******@gilanet.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
>>I have Access 2000. I made a mailing list database and for the life of
me can't remember how to format the zip code field so it will print on
the label as xxxxx-xxxx. I have tried various - 9, #, 0 - options but
the "-" is not printing. It is running the numbers together.

What am I doing wrong?

I am using the label wizard and have the table set with zip code as a
separate field.

Thanks
If ALL the records are in 9 digit value, using an unbound control:
=Format([ZIP],"00000-0000")

If you may have some 5 and 9 digit values, then use:
=IIf(Len([ZIP])>6,Left([ZIP],5) & "-" & Right([ZIP,4),Left([ZIP],5))

The above will work if the ZIP values are like 123456789 or 12345-6789
or 12345-.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Oct 2 '06 #3
The "-" must be a literal character in your format. I'm not sure about
it, because I seldom format my output :) but you should get any
character by prefixing it with a backslash.

So if your zip is a numerical field of 9 digits, "00000\-0000" will
return your format.

Carla schreef:
I have Access 2000. I made a mailing list database and for the life of
me can't remember how to format the zip code field so it will print on
the label as xxxxx-xxxx. I have tried various - 9, #, 0 - options but
the "-" is not printing. It is running the numbers together.

What am I doing wrong?

I am using the label wizard and have the table set with zip code as a
separate field.

Thanks
--
Bas Cost Budde
Holland
www.heuveltop.nl/BasCB/msac_index.html
Oct 2 '06 #4
Ok, in the design mode of the data table on the FORMAT line for the
PostalCode field, I took out the formatting. Trying to put anything in
there was making it worse - even the raw database was now joining the
numbers together if I tried to put 00000\-9999;0; in there or one of
the other suggestions.

Now, in a regular tabular report that I had previously made, my zip
code shows correctly. 99999- if there are no 4 digit extras, and
99999-0000 if there are.

My labels, tho, are now one label per line instead of 3 across, and the
numbers are still joined together.

In the design of the label it looks like this:

=Trim ([FirstName] & " " & [LastName])
=Trim([Address])
=Trim([City] & "" [State] & "" & [PostalCode]

The zip code in this label report is not showing a hyphen. I even
redid it to be sure. The zip code is run together with no hyphen. :(

To get the label report to show the zip code properly, where do I put
the formatting commands?

Oct 3 '06 #5
On 3 Oct 2006 08:47:51 -0700, Carla wrote:
Ok, in the design mode of the data table on the FORMAT line for the
PostalCode field, I took out the formatting. Trying to put anything in
there was making it worse - even the raw database was now joining the
numbers together if I tried to put 00000\-9999;0; in there or one of
the other suggestions.

Now, in a regular tabular report that I had previously made, my zip
code shows correctly. 99999- if there are no 4 digit extras, and
99999-0000 if there are.

My labels, tho, are now one label per line instead of 3 across, and the
numbers are still joined together.

In the design of the label it looks like this:

=Trim ([FirstName] & " " & [LastName])
=Trim([Address])
=Trim([City] & "" [State] & "" & [PostalCode]

The zip code in this label report is not showing a hyphen. I even
redid it to be sure. The zip code is run together with no hyphen. :(

To get the label report to show the zip code properly, where do I put
the formatting commands?
Always include the relevant part of any previous post when replying.
It makes it easier for someone to reply, as the previous message is
right in front of them.

There is no need to format the data in the table, as no one should be
looking at the table anyway.

In the report .......
Leave the Format PROPERTY of the control blank.
Use an UNBOUND control.
Set it's Control Source to:

=[City] & ", " [State] & " " &
IIf(Len([PostalCode])>6,Left([PostalCode],5) & "-" &
Right([PostalCode,4),Left([PostalCode],5))

** Note: I've added a comma and space after the City and a Space after
the State i.e. Omaha, NE 12345-6985

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Oct 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DBQueen | last post by:
I have a subform which is in Continuous Forms view. I have added a button to the bottom of the page to move to the next record using the button wizard (result: DoCmd.GoToRecord , , acNext). I...
4
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
4
by: Dave Brydon | last post by:
Access 2003 I have a combo box in my personnel table, which draws its data from a trade code table; the original field in the code table, is numeric, Long Integer, and formatted with 5 zero's . ...
10
by: Coleen | last post by:
Hi all :-) I have a weird formatting problem with an HTML table that I am populating using VB.Net and HTML. Here is the snippet of code for the cell I'm trying to format: Dim...
25
by: mdh | last post by:
Hi Group, Not looking for an answer, but more of an explanation. Thinking back to those heady days when you had the time to do them, may I ask this. Exercise 1-22 asks for a program to "fold"...
1
by: Russell Mangel | last post by:
I am using VS2005. When I paste source code into the code window, VS2005 formats like the following: public MsgRecipientReader() : base() { }
7
by: L. Scott M. | last post by:
Have a quick simple question: dim x as string x = "1234567890" ------------------------------------------------------- VB 6 dim y as string
8
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works...
14
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
10
by: afromanam | last post by:
Regards, Please help What I'm trying to do is this: (and I can't use reports since I must export to Excel) I export some queries to different tabs in an excel workbook I then loop through...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.