Based on what I'm understanding, you should have a linked table pointing to
a spreadsheet and one of the fields in that spreadsheet is named Ship To
Address and a query that takes the data from that linked table and appends
it to another table. In that append query, you tell Access to append the
value from the field named Ship To Address to the field named Customer
Address.
Am I misunderstanding the situation?
Even if you're not trying to append to a table, but instead are trying to
Union together the two linked tables and you want to control the names of
the fields, you can use aliases in your Union query.
SELECT FieldA AS F1, FieldC AS F2, FieldD AS F2
FROM LinkedTable1
UNION
SELECT Field1 AS F1, Field4 AS F2, Field6 AS F3
FROM LinkedTable2
will result in a recordset with fields named F1, F2, F3, regardless of what
the field is named in the original table.
In actual fact, you don't even need the aliases in the second part of the
query, since Union queries get their field names from the first subselect.
In other words, the follow SQL is all you really need:
SELECT FieldA AS F1, FieldC AS F2, FieldD AS F2
FROM LinkedTable1
UNION
SELECT Field1, Field4, Field6
FROM LinkedTable2
If your query was
SELECT FieldA, FieldC, FieldD
FROM LinkedTable1
UNION
SELECT Field1, Field4, Field6
FROM LinkedTable2
then the resultant recordset would have fields FieldA, FieldC, FieldD, even
though some of the rows would actually have called the fields Field1, Field4
and Field6.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Miche said:
Appending is not my issue.
My issue is I have two tables with alot of information in them that I want
to combine. These tables were spreadsheets are from two different
applications that have the same information but the field names are
different. I am looking for a way to combine these two tables into one by
telling Access that example- Customer is the same as Ship To and should
combine the two into Customer in my new table. Customer Address is the
same
as Ship To Address and should combine the two into Customer Address in my
new
table and so on.
BruceM via AccessMonster.com said:
I think Douglas is saying you would delete the monthly table and link to
the
new spreadsheet using a table of the same name. Last month's data has
been
appended from the monthly table to the main table, so there is no need to
keep that table. Since the monthly table has the same name each month,
the
append query will continue to work.
That is correct.
So each month, you delete the existing linked table and link to the
new
spreadsheet, naming the linked table the same as the previous month so
that
[quoted text clipped - 31 lines]
tables
together once I establish a link.