HOW DO I MAKE A SECUENCIAL NUMBER..

G

Graham R Seach

Pedro,

Public Function GetNextNumber() As String
Dim sTemp As String

sTemp = Format(Date, "mmddyyyy")

GetNextNumber = sTemp & Format(Nz(DMax("Mid(mynumber,9)", _
"mytable", "Left(mynumber, 8) = """ & sTemp & """"), 0) + 1, "000")
End Function

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
P

Pedro Ramos

Iam making a db where i need to dreate a autonumber that can do the follow:

todays date and a secuncial number
07092006001 = july 9 2006 secuencial 1
07092006002 = july 9 2006 secuencial 2


when the date in the system change the autonumber reset the count to 1
again:

07102006001 = july 10 2006 secuencial 1

07102006002 = july 10 2006 secuencial 2
 
T

Tim Ferguson

todays date and a secuncial number
07092006001 = july 9 2006 secuencial 1
07092006002 = july 9 2006 secuencial 2


You could always try putting the thing into first normal form by using two
fields for the two items of information...


Just a thought


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top