I need to generate a custom unique value for my primary key field (i.e order id). so far, i had little success by using functions in the default value but i still couln't get the other part to work.(add the other 4 auto numbers.)
my primary key
Order ID is a combination of 1st letter of the month, followed by year (4 digits), then 3rd letter of current month, then 4 digits (from 0000-9999) [this is where i got stucked].
for i.e. A2004R0001
A2004R0002 and so on.....
this is what i have in my general field properties - default value,
=Mid(MonthName(Month(Date()),True),1,1) & DatePart("yyyy",Date()) & UCase(Mid(MonthName(Month(Date()),True),3,1))
Example of my table
field data type
======== =========
Order ID Text
Customer ID Text
Date Date/Time
i am thinking maybe i could use 2 field, one for the already made default value, and one for the autonumber and then combine them together in the 3rd field. but the problem is for different month, it will start from 0001.
(btw, i dunno how to combine 2 fields into one field).
please help. thanks!
my primary key
Order ID is a combination of 1st letter of the month, followed by year (4 digits), then 3rd letter of current month, then 4 digits (from 0000-9999) [this is where i got stucked].
for i.e. A2004R0001
A2004R0002 and so on.....
this is what i have in my general field properties - default value,
=Mid(MonthName(Month(Date()),True),1,1) & DatePart("yyyy",Date()) & UCase(Mid(MonthName(Month(Date()),True),3,1))
Example of my table
field data type
======== =========
Order ID Text
Customer ID Text
Date Date/Time
i am thinking maybe i could use 2 field, one for the already made default value, and one for the autonumber and then combine them together in the 3rd field. but the problem is for different month, it will start from 0001.
(btw, i dunno how to combine 2 fields into one field).
please help. thanks!