Concactenating Date/Number

Judy

Registered User.
Local time
Today, 03:12
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
 
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

Back
Top Bottom