i need to generate rental numbers

TimjHebert

Registered User.
Local time
Yesterday, 20:40
Joined
Dec 12, 2004
Messages
40
Hi, I have a db and it contains one table and one form in a multi user enviroment. I need to generate an incrementing number to be used as a rental number without having duplicates. Could anyone suggest the best way to do this?

Thanks,
Tim
 
Can't you use an AUTONUMBER field on your table to generate this number?
That is usually the best and easiest approach.
We have used a parameter table that "keeps" a last value and a function to retreive and update that value with no problems, but that is more difficult.
You can always use the MAX function to return the last one on a table, but I ma not a real fan of this as it isnot fool proof in returning a duplicate number. But then again you always check to verify you do not have a duplicate before you store it.
 
i need to generate a rental number

Thanks for the reply, but i have read about duplicate numbers being genrated that way. This is going to be a multiuser database and i fear 2 people generating the same number.

Thanks
Tim
 
Duplicate numbers generated which way?
What ever method you use, you should always check to make sure the number does not exist before inserting. Other than an index with non duplicate values allowed, there is not a 100% method I am aware of. How ever even in a multi-user environment, it is rare the conditions exist to duplicate a number (but possible). We have found with the extra verify the number does not exist before insertion, we have not had any issues with duplicates no matter which method we have used. Even on large systems with many, many, MANY more users than Access supports.
Just my 2 cents
 

Users who are viewing this thread

Back
Top Bottom