I have an invoice form with two ado controls on it, one for the overall invoice information, like the ID number, customer, etc., and the other for the line items.

This form has been working without a problem until I recently added an update trigger to the orders table. The trigger responds to changes in an order's Status field. If Status is changed to "VOID", the trigger looks at each line item associated with this order, and increases the OnHand counter for each of the corresponding products by the Quantity in the line item. And it does the opposite if the status is changed from "VOID" to anything else. When I test this trigger in the SQL Enterprise Manager, it operates perfectly.

However, when I run my VB application and change the Status of an Invoice to or from "VOID", I get the following error message:

"Key column information is insufficient or incorrect. Too many rows were affected by update."

Thanks in advance for any ideas about what's causing this and what I can do about it.