473,657 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6104
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******@examp le.invalid> wrote in
news:c3******** *************** ******@40tude.n et:
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******@examp le.invalid> wrote in
news:c3******** *************** ******@40tude.n et:
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 ... "FullAddres s".
then create an update query:

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

The above is best for existing data.

2) For new data, add the "FullAddres s" 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******@examp le.invalid> wrote in
news:at******** *************** ******@40tude.n et:
On Sat, 24 Jul 2004 13:08:11 -0500, ND wrote:
fredg <fg******@examp le.invalid> wrote in
news:c3******** *************** ******@40tude.n et:
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 ... "FullAddres s".
then create an update query:

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

The above is best for existing data.

2) For new data, add the "FullAddres s" 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.1 96.97.131...
fredg <fg******@examp le.invalid> wrote in
news:at******** *************** ******@40tude.n et:
On Sat, 24 Jul 2004 13:08:11 -0500, ND wrote:
fredg <fg******@examp le.invalid> wrote in
news:c3******** *************** ******@40tude.n et:

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 ... "FullAddres s".
then create an update query:

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

The above is best for existing data.

2) For new data, add the "FullAddres s" 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
1603
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 be able to vary the fields that are compared. The example below shows how I'd like it to fit together. struct fields { fields( int f1, int f2, int f3 ){ m_f = f1; m_f = f2; m_f = f3; }
8
7091
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: BattID VehicleID STDATE STTIME CTC LKO500HF 00000000 10/27/2003 4:13:51 AM 4 LKO500HF 00000000 10/27/2003 5:13:51 AM 5 LKO500HF 00000000 10/27/2003 10:13:51 AM 6 LKO500HF 00000000 10/27/2003 11:13:51 AM 4
1
2455
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 exists off of 1 table and when I add a new field into the table I have no problem adding into the corresponding form. However when I add a new field to one of the following tables: - Employee List & Main Profile tables (This is what the combined...
0
427
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 Stored Procedure as its record source. The Proc is called MM_rptTeacherGroupingTest_sp. In order to help communicate the issue I am having with the report, please take a look at the following: http://www.valverde.edu/home/policy/ReportLayout.htm .
4
1534
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 to period for the two years for each user. Here's my problem - some of the users don't have all 26 periods (e.g. they started in period 3 of 2003). Is there any code to go through and see if period 1 exists for each user, and if it doesn't,...
2
2847
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 a bound checkbox field (Spanish) on the current record is True, and to 16777164 if the value of the bound checkbox field is False. The Subform's Name property is 'frmMainScores'. The Source Object Property of the Subform is 'frmMainSubScores'....
2
16137
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 to enter data into all of them. The form was created using the form wizard. I need to add new fields to one of the tables, and consequently, to the form. I can add the fields to the table, but not to the form. I've done this before with a form...
4
3125
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 so. Please and Thanks Omey
4
3489
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 names. My goal is to have one long list of all the names, not A next to B like one gets when you use the & operator. The eventual goal is to be able to print labels of all the individuals. I have no problem creating a label-Report from the Query....
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8608
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6172
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.