Custom autonumber with month prefix

abusaif

Registered User.
Local time
Today, 04:02
Joined
Oct 31, 2011
Messages
10
Hi there,

In a database I want to create an autonumber with prefix of first three letters of month i.e. Jan, Feb etc. Can anybody help.

Best regards to all :)
 
This is a conceptualization issue. First, this isn't an autonumber, lets call it a 'custom id'. To the database, because this is two distinct pieces of data (month and autonumber), you should set it up that way. That means whenever people need to see it you create this custom id by merging those two fields of your table and presenting it.

For example, if TableID was the autonumber field name and MonthData was the month field name, you could display this custom id by doing this:

=MonthData & "-" & TableID
 
This is a conceptualization issue. First, this isn't an autonumber, lets call it a 'custom id'. To the database, because this is two distinct pieces of data (month and autonumber), you should set it up that way. That means whenever people need to see it you create this custom id by merging those two fields of your table and presenting it.

For example, if TableID was the autonumber field name and MonthData was the month field name, you could display this custom id by doing this:

=MonthData & "-" & TableID

You are correct that this is a conceptualization issue, and your explanation as to why is correct, but it also depends on the interepretation of the OP's request. The result that the OP is looking for might also require a VB Function.

Your suggestion will create a Key that contains a three character Month followed by a running number. The problem that I can see with using an autonumber is that the number part of the Key would not reset at the beginning of each new month. If this is OK, then your change would be all that is required. If not, then a VB Function that creates the Key by adding 1 to the current value of the number part of the Key, and resets the number part of the Key to 1 whenever the Month changes, would be in order.
 

Users who are viewing this thread

Back
Top Bottom