Concactenating Date/Number (1 Viewer)

Judy

Registered User.
Local time
Today, 05:03
Joined
Sep 26, 2000
Messages
34
I need to generate a file number which will consist of the date, formatted as yymmdd and a running number of records for the date, for example, 02062501, 02062502, etc. I tried using:

Count(DLookup(field, "qry", Date())),

on the form's before insert event, but it didn't work. Any ideas?

Thanks,

Judy
 

David R

I know a few things...
Local time
Yesterday, 23:03
Joined
Oct 23, 2001
Messages
2,633
You're close: try DCount

Dcount("[DateFieldName]","[TableOrQueryName]","[DateFieldName] = " & Date()) should do it. What happens if the record count goes down later though (say one gets deleted because it was an accident). Could you end up with duplicate numbers that way?
 

Users who are viewing this thread

Top Bottom