Dim sql As String On Error GoTo MsgErr If DCount("[ItemCode]", "[InvoiceTT]", "[InvoiceCode]=" & Me.InvoiceCode & "and [ItemCode]=" & Me.ItemCode) > 0 Then sql = "UPDATE [InvoiceTT] SET [InvoiceTT].QCB = [InvoiceTT]![QCB]+[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![QCB] WHERE ((([InvoiceTT].InvoiceCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![InvoiceCode]) AND (([InvoiceTT].ItemCode)=[Forms]![InvoiceHFB]![InvoiceTFB].[Form]![ItemCode]));" sql1 = "UPDATE [InvoiceTT] SET [In