this can be done with zero programming. Set the date field to date/time ,
with default = now()
format = General Date
the records can now be ordered in time order. It does not start at 1 like your example but it is equivalent with zero programming.
if you want to use vba:
Now when you need to make a new work order for a new day,
get the MAX value for THAT date,
then either start from 1 (if null) or add +1 if this day exists:
make a query to pull the [RWO] and the bare date values in the RWO. (left 5, no day#)
in the query: qsDateVals,
SELECT [RWO],(Left([RWO],5)) AS DateVal FROM tData;
Bookmarks