updating/adding to another table

  • Thread starter Thread starter Marius Kaizerman
  • Start date Start date
M

Marius Kaizerman

Hi,

I'm working with access and sql server.
I have two tables.
Fields in table #1: barcode
(unique),transfer_to,quantity_of_items,supplier,price,date_of_shipment
Fields in table #2: barcode (unique),transfer_to(unique),quantity_of_items
The first table is updated manually using a form, and the second should be
updated by the form itself
at the end of each record.
Note: in table #2, "barcode" and "transfer_to" fields are unique.
At the end of entering a record in table #1, if "barcode" and "transfer_to"
fields exists in table #2,
I want that the "quanity_of_items" field in table #1 will be added to those
in table #2. But if "barcode" and "transfer_to" does not exist in table #2,
I want that a record will be added with the same data
(barcode,transfer_to,quantity_of_items).
How can this be done in access/sql ?

Thanks.
 
Whew!
That's a lot of cross-posting you're doing there!
It's usually considered appropriate to limit cross-posts to 2 or 3 groups.

As for your question -
is there some reason you need to keep table 2 data in a separate table?
It seems to me you could use a query (or view in SQL Server) to retrieve
this information from Table 1 on an "as needed" basis.

HTH
- Turtle
 
Back
Top