Hello,
I am creating a form that displays invoice entries that contractors submit for payment. At the top of my Access form I have a control that should display a duplicates warning if the record has a duplicate order number [OrderNo] or project id [ProjectID] that is already in the tblInvoiceSubmissions. The contractors can only be paid once per order/project.
I am currently using an expression with the DCount function but it occurred to me that unlike the sample I based this expression off, my fields are data type-number and not text.
I currently have...
=IIf(DCount("*","[tblInvoiceSubmissions]","[ID]<>" & Nz([ID],0) & " And [OrderNo] = '" & Replace(Nz([OrderNo]),"'","''") & "'")>0,"Possible Duplicate Order","")
Can anyone tell me how to re-write this being that[OrderNo] is a number. And how to add that the [ProjectID] field should be counted as well.
I'm trying to say...
If number of occurrences in which the same [OrderNo] or [ProjectID] within the table "tblInvoiceSubmissions" is greater than 0 display "Possible duplicate order".
I tried just removing the quotes but I wasn't sure which ones. It has been impossible to find examples of DCount syntax for numbers only text. Any help that can be offered would be a Godsend. I have a tight deadline and this is the last function to be added. Thanks for your help in advance!