You can't update two tables with a single
UPDATE
statement, if you are trying to do something like so. But you can use
JOINS
to get the data for updation to one table and can be used for fiter etc.
Doing corrections to your query should look like following-
cmd = new OleDbCommand("UPDATE Inv set Description ='" + txtProductName + "',Quantity = '" + txtQty.Text + "',UOM = '" + txtUOM.Text + "',UnitPrice ='" + txtUnitPrice.Text + "',GrossAmount ='" + txtGrossAmount.Text + "',VAT = '" + txtVAT.Text + "',VatAmount ='" + txtVatAmount.Text + "',Total ='" + txtTotal.Text + "' FROM InvoiceItems Inv INNER JOIN TAXINVOICE TInv on Inv.InvoiceNumber=TInv.InvoiceNumber where Inv.InvoiceNumber=" +txtInvoice.Text.Trim(),conn);
Note: As I already said, all the columns in your
UPDATE
statement those you want to update should be from the table mentione in
UPDATE table_name
only(i.e, InvoiceItems in your case).
Please let me know, if you are trying achieve something else.
:)