
Comparing two tables and then updating one table.
I think there is a none VB code way to do what you want. Use an Action
Query. Create a select query to view the information that you want to
add. In other words, if you want it to compare what records are new
from one table, to another, put query criteria that shows only those
records that do not equal certain fields in another table. As far as
action queries go, you can create a Make Table query that would make a
Table with the information you want, or you can use and Update Query,
or Append Query, definitions for both of these are in the help files.
Tell you the truth, I actually took a basic Access class a few weeks
ago, even though I have already learned how to use VB code on my own,
and I got a lot out of it just with how queries work. And the nifty
trick, which I didn't find out in the class, but on my own, is that you
can create a query to modify, sort, or delete information as you want,
and then change it to SQL view, and use that SQL in code. This way you
can have the SQL in code modified by the code itself to do what you
want. (I don't like to modify queries from code, I think it is easier
to just modify SQL and run the SQL.)
Crying Wolf
Quote:
> If anybody can help me with the following I would greatly appreciate
it.
> I have been tasked to move data that has been downloaded from a
mainframe
> into a table and to add any new records and then update the existing
records
> two fields. Unfortunately the database was set up with a primary
field based
> on an autonumberso that is causing me some headaches.
> I can successfully import the comma delimited data into a transition
table -
> ztAccountCodes.
> I then want to check for any new records against table -
tblAccountCodes
> (five fields Account Codes, Cost Centre, Description, Expenditure and
> Commitment. my table ztAccountCodes has a primary field based on
Account
> Codes + Cost Centre (these are a unique combination in both tables.
> I have tried creating recordsets and dynaset without success. Any
hints
> would be greatly appreciated.
> Regards Phill
--
He who learns but does not think is lost, he who thinks but does not lea
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.