Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if invoice already exists in table.

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
579
0
16
GB
Hello, I am using the code below to check if an invoice has already been put into the table.

Even when one is in it returns 0 - any ideas?

Thanks Mark

Code:
MsgBox DCount("Inv_Paid_Date", "qry_Invoice_Check", "[Inv_Pman_Cont_ID_Link] = " & Me.txt_Pman_Cont_ID & " AND [Inv_Invoice_No] = '" & Me.txt_Invoice_Number & "'")
 
What do you get if you run this:

[pre]
Select Count(Inv_Paid_Date)
From qry_Invoice_Check
Where Inv_Pman_Cont_ID_Link = [red]1234[/red]
And Inv_Invoice_No = '[red]XYZ123[/red]'
[/pre]
Substitute [red]these[/red] with some valid values.


---- Andy

There is a great need for a sarcasm font.
 
Thank you for your help with this.

A bit of code blindness from me. I was checking against invoices paid, instead of all invoices. Thank you for taking the time to help me.

Mark
 
Any time... [wavey3]


---- Andy

There is a great need for a sarcasm font.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top