Update Querie D Sum

G

Guest

This query leaves the fields where it does not find [4Shipment
Detail]![Dilivery note Detail ID] = " & [2Deliv note detail]![Deliv note
detail ID] blank. The basics works wonderful

It must where[4Shipment Detail]![Dilivery note Detail ID] <> " & [2Deliv
note detail]![Deliv note detail ID],[2Deliv note detail]![Delivered
Cartons]-0. Where did I go wrong now again.

UPDATE [2Deliv note detail] SET [2Deliv note detail].[Cartons Remaining] =
[2Deliv note detail]![Delivered Cartons]-DSum("[Shipped Cartons] ","4Shipment
Detail"," [4Shipment Detail]![Dilivery note Detail ID] = " & [2Deliv note
detail]![Deliv note detail ID]);
 
J

John Vinson

This query leaves the fields where it does not find [4Shipment
Detail]![Dilivery note Detail ID] = " & [2Deliv note detail]![Deliv note
detail ID] blank. The basics works wonderful

It must where[4Shipment Detail]![Dilivery note Detail ID] <> " & [2Deliv
note detail]![Deliv note detail ID],[2Deliv note detail]![Delivered
Cartons]-0. Where did I go wrong now again.

UPDATE [2Deliv note detail] SET [2Deliv note detail].[Cartons Remaining] =
[2Deliv note detail]![Delivered Cartons]-DSum("[Shipped Cartons] ","4Shipment
Detail"," [4Shipment Detail]![Dilivery note Detail ID] = " & [2Deliv note
detail]![Deliv note detail ID]);

If you want to enter a zero where [Deliv note detail ID] is not found
in the 4Shipment Detail table, use the NZ function:

UPDATE [2Deliv note detail]
SET [2Deliv note detail].[Cartons Remaining] =
[2Deliv note detail]![Delivered Cartons] -
NZ(DSum("[Shipped Cartons] ","4Shipment Detail",
"[4Shipment Detail]![Dilivery note Detail ID] = " &
[2Deliv note detail]![Deliv note detail ID]));

John W. Vinson[MVP]
 

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