Field Concatenation in a single table

M

Mr. Beginner

I have imported 160,000 records from an Excel file into an Access table
called "Vendor Master". The Vendor Master table has 3 fields, all text, that
I would like to combine into 1 field to be used as a key field.

I created a new field called "VIN" to combine the 3 other fields, but can't
seem to get the expression right......... if in fact I should be even using
an expression?

GIVEN INFO: Database Name - CSU
Table Name - Vendor Master
Field#1 Name - PRE
Field#2 Name - FEID
Field#3 Name - EXT

My failed expression in default value: =[Vendor Master]!
&+[Vendor
Master]![FEID]&+[Vendor Master]![EXT]

I keep getting an error message saying that Access can't find my field
names? Where did I go wrong?

HELP! HELP! HELP! HELP!
 
K

KARL DEWEY

If they have individual meaning then keep them separate and only combine when
needed for display in a query, form, or report.
To concatenate in a query design view use this --
VIN:
 & [FEID] & [EXT]

In query SQL use this --
[Vendor Master].
 & [Vendor Master].[FEID] & [Vendor Master].[EXT] AS VIN
 
J

John W. Vinson

I have imported 160,000 records from an Excel file into an Access table
called "Vendor Master". The Vendor Master table has 3 fields, all text, that
I would like to combine into 1 field to be used as a key field.

It is neither necessary nor desirable to do so. A Primary Key can consist of
one field - or *ten* fields if necessary!

Open the table in design view; ctrl-click these three fields; and click the
Key icon. This will make the three fields a joint Primary Key; you will be
allowed duplicates in any one or two of the fields but no records which are
duplicates in all three.

You can concatenate the fields *for display purposes* in a query with a syntax
like

VIN:
 & [FEID] & [EXT]

The ! syntax is appropriate for form objects (. is the delimiter between
tablenames and fieldnames), and if the fieldnames are all in the same table
you don't need to specify the tablename at all; in addition, you were using
both the & and + operators - either one is a concatenation operator but you
don't need both.
 

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

Similar Threads


Top