Thanks for the quick response. One additional question though. The
recordset I am looking into, what you refer to in you code as "TblInvoice"
is actually a DAO recordset I created from a query with the following:
Set qdf = db.QueryDefs(stDocName)
Set prm = qdf.Parameters(0)
'Set parameter value
prm = strFile
'Execute QueryDef to produce a recordset
Set rs = qdf.OpenRecordset
Is there a way to reference the recordset in place of the "TblInvoice" in
your code? If not, could I set up two criteria in your code, one for
"File" and the second for "InvoiceNumber"?
I tried a few variations with no luck.
Thanks again for the help. I am keeping a file that illustrates and
explains any sample code or suggestions I receive through my various
postings. Hopefully one day I will learn this well enough to not be such a
frequent "poster" or even make some suggestions to others.
PC Datasheet said:
DCount("*","TblInvoice","[InvoiceNumber] = 2")
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
Gibson said:
Is it possible to find the recordcount of a recordset that contains a
specific field. I mean if a recordset lists multiple records for 5
different invoices can I, through code, get the number of records for
invoice number 2?
Thanks