making a key using Dmax

StupidStudent

Registered User.
Local time
Today, 15:27
Joined
Mar 12, 2007
Messages
29
Hi thanks to everyone who helped me before or added to this site loads of awsome info.......

I have a problem generating a number for a primary key

I have a form where the user can add a new plant and I currently have the key set to = "pc" & Int((1000*Rnd())+1)

However this has no validation rules and have heard that Dmax would be more accurate??

the table used is just Plant with the primary key set to PlantCode

ANY HELP WOULD BE AWSOME

Thanks peps
 
Why not just use an AutoNumber field and have the PlantCode as a separate field?
 
Hi thanks for super quick response

Its for a uni project and tutor told us that autoNumber is a big no no

not sure y?? :confused:

However if this is the best way of doing it then i shall give it a go??

so do you think i should set the primary key to auto number??

THANKS
 
YES! And ask the tutor why not use AutoNumber. It has some drawbacks but a lot of plus factors as well.
 

Users who are viewing this thread

Back
Top Bottom