Order number

Robertja

New member
Local time
Today, 12:21
Joined
Mar 24, 2014
Messages
3
Hello all hope someone can help me with this small issue I have. I have a orders database that I use to published work orders so here is my problem. I have a box call orders number that should be reseted everyday back to 0 so the next day the first orders number should start at 01. How do I write the syntax for this.
 
Robertja,

In your Orders Table you should have two fields:

OrderDate - Default Value = Date <-- Today
OrderNumber

Then whenever you insert a new record:

Me.OrderNumber = Nz(DMax("[OrderNumber]", "OrdersTable", "[OrderDate] = #" & Date & "#), 0) + 1

Then for reports and such you can display something like:

OrderNumberDisplay: Format(OrderDate, "YYYYMMDD") & "-" & CStr([OrderNumber])

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom