Hello friends,
I have a form where we enter invoices to be paid into Accounts Payables. I have a new entry clerk that keeps entering the same invoice to be paid. I need to add some data verification checks to stop this. The form starts with a combo box to select the vendor. Then the user keys in an invoice number. Is it better to put some code in the afterupdate event of the Invoice Number control or in the before update event of the form or both? This form has a subform where the line item details are added but I want to stop the user before they get that far. Also, would someone please provide some code sample? I have created a query that will identify the duplicate invoices from the invoiceheader table. Here it is:
SELECT InvoiceHeader.[VendorID], InvoiceHeader.[InvoiceNumber], InvoiceHeader.[InvoiceDate], InvoiceHeader.[InvoiceAmount], InvoiceHeader.[Voucher#]
FROM InvoiceHeader
WHERE (((InvoiceHeader.[VendorID]) In (SELECT [VendorID] FROM [InvoiceHeader] As Tmp GROUP BY [VendorID],[InvoiceNumber] HAVING Count(*)>1 And [InvoiceNumber] = [InvoiceHeader].[InvoiceNumber])))
ORDER BY InvoiceHeader.[VendorID], InvoiceHeader.[InvoiceNumber];
Thanks,
Doyce
Posted by: winberry.doyce@roadsysinc.com
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar