Joining two fields

  • Thread starter Thread starter Brian Kelly
  • Start date Start date
B

Brian Kelly

I want to join the numerical data from two separate fields
into a 3rd field (but not sum the data).

For example:
I have a field called ID - let's say the number is 12345
I have a field called ID-suff - there are two options 1 or
0
I want to create a field called COMP_ID that would read
1234560 or 1234561

How do I do this?
 
I want to join the numerical data from two separate fields
into a 3rd field (but not sum the data).
For example:
I have a field called ID - let's say the number is 12345
I have a field called ID-suff - there are two options 1 or
0
I want to create a field called COMP_ID that would read
1234560 or 1234561

How do I do this?

Don't store this composite value in a Table - it's redundant and it
would be unwise to do so!

You can calculate it on the fly using the CStr() function to convert
ID to a String, and concatenating: in a vacant Field cell type

Comp_ID: Cstr([ID]) & [ID-suff]

If you're creating this composite field in order to serve as a unique
index, be aware that you can create a Primary Key or a unique index on
multiple fields: you don't need the composite field for this purpose.
Just ctrl-mouseclick both ID and ID-suff so that they are both
highlighted and click the Key icon.
 
The Concatenation operator - &

Newfield: Field1 & Field2


--
HTH,

Steve Clark, Access MVP
FMS, Inc.
Professional Solutions Group
http://www.FMSInc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Is your Access database too slow?
Are you ready to upgrade to SQL Server?
Contact us for optimization and/or upsizing!
http://www.FMSInc.com/consulting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top