By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,761 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,761 IT Pros & Developers. It's quick & easy.

updating/adding to another table

P: n/a
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,pr ice,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.
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
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

"Marius Kaizerman" <ma****@kaizerman.org> wrote in message
news:ne********************@lnews.actcom.co.il...
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,pr ice,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.

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.