Unique reference based on PK and user selection

deejay_totoro

Registered User.
Local time
Today, 02:37
Joined
May 29, 2003
Messages
169

Hello,

I am trying to create a unique reference number that includes the default autonumber and another count based on what the user selects from a dropdown (B).

For example, the reference might look something like these examples:

Auto DropdwnA DropdwnB Count
001 Drink Mocha 1
002 Drink EGrey 1
003 Drink Espresso 1
004 Drink Latte 1

005 Drink EGrey 2
006 Drink EGrey 3
007 Drink EGrey 4

008 Drink Espresso 2
009 Drink Latte 2
010 Drink Espresso 3

I will eventually create a unique reference by combining all the data (ie: 004-Drink-Latte-1, 010-Drink-Espresso-3) but it will allow me to number each type of drink in ascending order irrespective of the autonumber (which is the primary key.)

I would appreciate any advice on how to approach this! I am baffled!

Thanks,

dj_T







:eek:
 
Just make all the fields you wish to include a 'key' field. Access will then prevent you from entering any data where any record has these fields the same as any other.

Sam
 
One other thing. You must get rid of the Autonumber. If you don't then all the key fields will never be unique.

Sam
 

Users who are viewing this thread

Back
Top Bottom