473,398 Members | 2,125 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,398 software developers and data experts.

making new field that combines three other fields?

ND
I need to create a separate field from 4 fields, "street address", "city",
"State" and "zip code". For example,

Street address - 100 Forest Street
City - Seattle
State - WA
Zip - 05555

Would become:

100 Forest Street, Seattle, WA, 05555

Any idea how to do this?

Thanks.
Nov 13 '05 #1
5 6081
On Sat, 24 Jul 2004 12:21:28 -0500, ND wrote:
I need to create a separate field from 4 fields, "street address", "city",
"State" and "zip code". For example,

Street address - 100 Forest Street
City - Seattle
State - WA
Zip - 05555

Would become:

100 Forest Street, Seattle, WA, 05555

Any idea how to do this?

Thanks.


regarding: >I need to create a separate field from 4 fields<

If by "separate field" you mean a new field in a table to store the
combined data, no you don't. Derived data, such as this, should not be
stored in any table. If the value of one of the entries, such as
[StreetAddress] is changed, then you no longer have correct values in
this combined field.

If however, you mean to put the fields together in an unbound (not
tied to a table) control in a form or report, then that is easily
done.

Add an unbound control to the report.
To display the data as
100 Forest Street, Seattle, WA, 05555
set it's Control Source to:

=[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]
To combined the fields into a proper mailing address format,
100 Forest Street
Seattle, WA 05555
use:

=[StreetAddress] & chr(13) & chr(10) & [City] &", " & [State] & " " &
[Zip]

But don't save the combined address data! It's not necessary.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
ND
fredg <fg******@example.invalid> wrote in
news:c3*****************************@40tude.net:
On Sat, 24 Jul 2004 12:21:28 -0500, ND wrote:
I need to create a separate field from 4 fields, "street address",
"city", "State" and "zip code". For example,

Street address - 100 Forest Street
City - Seattle
State - WA
Zip - 05555

Would become:

100 Forest Street, Seattle, WA, 05555

Any idea how to do this?

Thanks.
regarding: >I need to create a separate field from 4 fields<

If by "separate field" you mean a new field in a table to store the
combined data, no you don't. Derived data, such as this, should not be
stored in any table. If the value of one of the entries, such as
[StreetAddress] is changed, then you no longer have correct values in
this combined field.


I actually do need to merge this data into a single field. I'm importing
the information into ArcGIS for determining the geographic location of
addresses on a map and the format they require merges all that data
together. We will continue to enter data manually into the original
separated fields but I can either create a merged field to do this
transformation automatically or I can manually merge the data together
(which won't happen). Is there a way to define a field using the format
below so that the field will update itself? Thanks.

If however, you mean to put the fields together in an unbound (not
tied to a table) control in a form or report, then that is easily
done.

Add an unbound control to the report.
To display the data as
100 Forest Street, Seattle, WA, 05555
set it's Control Source to:

=[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]
To combined the fields into a proper mailing address format,
100 Forest Street
Seattle, WA 05555
use:

=[StreetAddress] & chr(13) & chr(10) & [City] &", " & [State] & " " &
[Zip]

But don't save the combined address data! It's not necessary.


Nov 13 '05 #3
On Sat, 24 Jul 2004 13:08:11 -0500, ND wrote:
fredg <fg******@example.invalid> wrote in
news:c3*****************************@40tude.net:
On Sat, 24 Jul 2004 12:21:28 -0500, ND wrote:
I need to create a separate field from 4 fields, "street address",
"city", "State" and "zip code". For example,

Street address - 100 Forest Street
City - Seattle
State - WA
Zip - 05555

Would become:

100 Forest Street, Seattle, WA, 05555

Any idea how to do this?

Thanks.


regarding: >I need to create a separate field from 4 fields<

If by "separate field" you mean a new field in a table to store the
combined data, no you don't. Derived data, such as this, should not be
stored in any table. If the value of one of the entries, such as
[StreetAddress] is changed, then you no longer have correct values in
this combined field.


I actually do need to merge this data into a single field. I'm importing
the information into ArcGIS for determining the geographic location of
addresses on a map and the format they require merges all that data
together. We will continue to enter data manually into the original
separated fields but I can either create a merged field to do this
transformation automatically or I can manually merge the data together
(which won't happen). Is there a way to define a field using the format
below so that the field will update itself? Thanks.
If however, you mean to put the fields together in an unbound (not
tied to a table) control in a form or report, then that is easily
done.

Add an unbound control to the report.
To display the data as
100 Forest Street, Seattle, WA, 05555
set it's Control Source to:

=[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]

To combined the fields into a proper mailing address format,
100 Forest Street
Seattle, WA 05555
use:

=[StreetAddress] & chr(13) & chr(10) & [City] &", " & [State] & " " &
[Zip]

But don't save the combined address data! It's not necessary.


A couple of ways you can do this.

1) Run an update query to concatenate the separate fields into one
field:
Add a new field to the table ... "FullAddress".
then create an update query:

Update YourTableName Set YourTableName.FullAddress = [Address] & ", "
& [City] & ", " & ", " & [Zip];

The above is best for existing data.

2) For new data, add the "FullAddress" field to the table.
Then use a form to enter the data into the separate fields as you do
now.
Add the [FullAddress] field to the form. (You can make it not visible
if you don't want to actually see it.)

Code the Form's BeforeUpdate event:
[FullAddress] = [StreetAddress] & ", " & [City] &", " & [State] & ", "
& [Zip]

The FullAddress data will be added to the table when you navigate to
the next record, or save the current record.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #4
ND
fredg <fg******@example.invalid> wrote in
news:at*****************************@40tude.net:
On Sat, 24 Jul 2004 13:08:11 -0500, ND wrote:
fredg <fg******@example.invalid> wrote in
news:c3*****************************@40tude.net:
On Sat, 24 Jul 2004 12:21:28 -0500, ND wrote:

I need to create a separate field from 4 fields, "street address",
"city", "State" and "zip code". For example,

Street address - 100 Forest Street
City - Seattle
State - WA
Zip - 05555

Would become:

100 Forest Street, Seattle, WA, 05555

Any idea how to do this?

Thanks.

regarding: >I need to create a separate field from 4 fields<

If by "separate field" you mean a new field in a table to store the
combined data, no you don't. Derived data, such as this, should not
be stored in any table. If the value of one of the entries, such as
[StreetAddress] is changed, then you no longer have correct values
in this combined field.


I actually do need to merge this data into a single field. I'm
importing the information into ArcGIS for determining the geographic
location of addresses on a map and the format they require merges all
that data together. We will continue to enter data manually into the
original separated fields but I can either create a merged field to
do this transformation automatically or I can manually merge the data
together (which won't happen). Is there a way to define a field using
the format below so that the field will update itself? Thanks.
If however, you mean to put the fields together in an unbound (not
tied to a table) control in a form or report, then that is easily
done.

Add an unbound control to the report.
To display the data as
100 Forest Street, Seattle, WA, 05555
set it's Control Source to:

=[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]

To combined the fields into a proper mailing address format,
100 Forest Street
Seattle, WA 05555
use:

=[StreetAddress] & chr(13) & chr(10) & [City] &", " & [State] & " "
& [Zip]

But don't save the combined address data! It's not necessary.


A couple of ways you can do this.

1) Run an update query to concatenate the separate fields into one
field:
Add a new field to the table ... "FullAddress".
then create an update query:

Update YourTableName Set YourTableName.FullAddress = [Address] & ", "
& [City] & ", " & ", " & [Zip];

The above is best for existing data.

2) For new data, add the "FullAddress" field to the table.
Then use a form to enter the data into the separate fields as you do
now.
Add the [FullAddress] field to the form. (You can make it not visible
if you don't want to actually see it.)

Code the Form's BeforeUpdate event:
[FullAddress] = [StreetAddress] & ", " & [City] &", " & [State] & ", "
& [Zip]

The FullAddress data will be added to the table when you navigate to
the next record, or save the current record.


Thank you much. I appreciate the help.
Nov 13 '05 #5
Hi ND,

Another comment from 'way out in the bleachers: you wrote that you were
importing the data into ArcGIS. What's the current mechanism? How flexible
can you be about how the data gets where? I share Fred's aversion to
storing the merged field in the database; gross violation of relational
rules don'cha know.

You can easily create a separate table with all of the other data and just
the merged field form of the address without the fields with the individual
bits. You can use a Make Table query or you can run a Make Table once and
then use code to run a Delete query to empty the new table and an Append
query to fill it again.

The query would look much as it does now but you would click off the Show
checkbox for the fields that will be merged. You can create a new merged
data field by treating the data similarly to what Fred has shown.
MergedData: =[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]
Your new field is MergedData and has the goodies.

If it were mine to do I'd want that data outside my application, maybe in an
Excel spreadsheet or in a CSV file.

HTH
--
-Larry-
--

"ND" <nd@nd2.nd2.com.invalid> wrote in message
news:Xn********************************@216.196.97 .131...
fredg <fg******@example.invalid> wrote in
news:at*****************************@40tude.net:
On Sat, 24 Jul 2004 13:08:11 -0500, ND wrote:
fredg <fg******@example.invalid> wrote in
news:c3*****************************@40tude.net:

On Sat, 24 Jul 2004 12:21:28 -0500, ND wrote:

> I need to create a separate field from 4 fields, "street address",
> "city", "State" and "zip code". For example,
>
> Street address - 100 Forest Street
> City - Seattle
> State - WA
> Zip - 05555
>
> Would become:
>
> 100 Forest Street, Seattle, WA, 05555
>
> Any idea how to do this?
>
> Thanks.

regarding: >I need to create a separate field from 4 fields<

If by "separate field" you mean a new field in a table to store the
combined data, no you don't. Derived data, such as this, should not
be stored in any table. If the value of one of the entries, such as
[StreetAddress] is changed, then you no longer have correct values
in this combined field.

I actually do need to merge this data into a single field. I'm
importing the information into ArcGIS for determining the geographic
location of addresses on a map and the format they require merges all
that data together. We will continue to enter data manually into the
original separated fields but I can either create a merged field to
do this transformation automatically or I can manually merge the data
together (which won't happen). Is there a way to define a field using
the format below so that the field will update itself? Thanks.

If however, you mean to put the fields together in an unbound (not
tied to a table) control in a form or report, then that is easily
done.

Add an unbound control to the report.
To display the data as
100 Forest Street, Seattle, WA, 05555
set it's Control Source to:

=[StreetAddress] & ", " & [City] &", " & [State] & ", " & [Zip]

To combined the fields into a proper mailing address format,
100 Forest Street
Seattle, WA 05555
use:

=[StreetAddress] & chr(13) & chr(10) & [City] &", " & [State] & " "
& [Zip]

But don't save the combined address data! It's not necessary.


A couple of ways you can do this.

1) Run an update query to concatenate the separate fields into one
field:
Add a new field to the table ... "FullAddress".
then create an update query:

Update YourTableName Set YourTableName.FullAddress = [Address] & ", "
& [City] & ", " & ", " & [Zip];

The above is best for existing data.

2) For new data, add the "FullAddress" field to the table.
Then use a form to enter the data into the separate fields as you do
now.
Add the [FullAddress] field to the form. (You can make it not visible
if you don't want to actually see it.)

Code the Form's BeforeUpdate event:
[FullAddress] = [StreetAddress] & ", " & [City] &", " & [State] & ", "
& [Zip]

The FullAddress data will be added to the table when you navigate to
the next record, or save the current record.


Thank you much. I appreciate the help.

Nov 13 '05 #6

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

Similar topics

4
by: titancipher | last post by:
I have a container that I wish to allow the user to specify a custom comparison method very similar to std::less. However, I want it to function more like memcmp (returning -1 0 1), and I want to...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
1
by: Tony D. | last post by:
I could really use some help with a problem I am having. I am trying to add a new field to an existing form that combines two tables into one form. In this same databse I have another form that...
0
by: CSDunn | last post by:
Hello, I have a format issue on an Access 2000 ADP report that I am going to attempt to explain from a 'ten thousand foot view' : I have an Access 2000 ADP report that has a SQL Server 2000...
4
by: No Spam | last post by:
Dear Access 2000 users, We have two tables, named 2003 and 2004. Each table contains 3 fields. User Name, Period (numbered from 1 to 26), and Amount. We'd like to compare amounts from period...
2
by: CSDunn | last post by:
Hello, In an Access 2003 ADP Subform, I am trying to set the BackGround color of three textbox fields (LSScore, RScore, WScore) in the current record of the subform to zero (black) if the value of...
2
by: Randy A. Bohannon | last post by:
This is probably a simple thing to do, but I can't find how in the help files or the manual I have. I'm using Access 2000. I have three tables joined by a common field, and I'm using one form...
4
by: Omey Samaroo | last post by:
Dear Access Gurus, Can anyone provide me with some much needed assistance. I would like to combine the contents of 3 text fields into one field. Can someone provide some code or a method to do...
4
by: justin tyme | last post by:
Hello Experts! I would like to combine (which may not be the correct technical term) two text fields from the same table in a query. Specifically, text field A and text field B are both lists of...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.