Link to home
Start Free TrialLog in
Avatar of EclecticBob
EclecticBob

asked on

Ms Access SQL not updating when form is open

I have form that prints an Invoice. When the invoice is printed it updates the inventory table to adjust for the number of items sold. I do this with the following statement.

    DoCmd.RunSQL "UPDATE tblInvoiceDetail INNER JOIN tblInventoryData ON " _
    & "tblInvoiceDetail.Partno = tblInventoryData.Partno SET " _
    & " tblInventoryData.QuanInStock = [tblInventoryData].[QuanInStock]-[tblInvoiceDetail].[OrderQuan] " _
    & "WHERE (((tblInvoiceDetail.[InvNo])=" & InvNo & ") AND ((tblInventoryData.DropShip)<>-1));"
   
This works perfectly but if my Inventory form is also open to one fo the items being updated, the update for that item does not occur. What can I do to fix this?
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of EclecticBob
EclecticBob

ASKER

Thank you, I'd rather not have to close the form but the SaveForm routine looks like the solution.