How to read a table record by record and process and update another table

K

Karen Middleton

Hello All

I have tableA and tableB I want to update tableB by reading each
record from TableA and before updating a record from TableA into
TableB I want to lookup three other tables and perform lot of if then
else kind of analysis.

I would have done this with a stored procedure in SQL Server since we
cannot do Stored procedures in Access can you kindly share with me a
simple VBA Macro sample of how to read data from tableA which as the
following fields - Customer, Month, Year, Sales, Qty and tableB as the
same tables as TableA.


Please kindly share the VBA code how I can read a table and its fields
from TableA and update TableB fields in between I want to lookup a few
tables.

Thanks
Karen
 
J

Jeff Boyce

Karen

There may be a more critical underlying question you need to consider first.
If both TableA and TableB have the same structure (and it isn't clear if
this is the case):
tableA which as the
following fields - Customer, Month, Year, Sales, Qty and tableB as the
same tables as TableA.

I wonder "why?". It is not all that common in a well-normalized relational
database to have identical structure in more than one table. In addition to
being redundant (i.e., unnecessary), it exposes your database to data
integrity issues (data in A may not match data in B).
 

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

Top