Update muliple records query

  • Thread starter Thread starter darkoko
  • Start date Start date
D

darkoko

Hi,
I need to update multiple records something like this:
I have item A and item B and and both quantity is 0.
Then I have in a form like I want to enter for item A to be one in quantity,
and for item B two in quantity.
I have made query like this >
UPDATE Delovi SET Delovi.Kolic = (Delovi!Kolic)+forms!porudzbine!QPorDelovi.
Form!Koliciina
WHERE Delovi.KatBR in (select katbr from pordelovi where brpor=Forms!
[Porudzbine]![BrPor]);

But with this query it just enterone in quantity for both item, so I need to
make a query that will sum separate every record...
Thanx
 
Hi,


Maybe something like:



UPDATE delovi
SET kolic=SWITCH(type="a", FORMS!porudsbine!QPorDelovi_A,
type="b", FORMS!porudsbine!QPorDelovi_B)
WHERE type IN ("a", "b")




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top