Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber, 4 digits

Status
Not open for further replies.

WantoN

ISP
Jul 4, 2005
22
0
0
GB
Hi guys,
I'm creating a new table, and want to create a field whereby when you enter a new record, a random 'Customer ID' is generated with four digits, which is never duplicated.

How do I go about doing this?

Cheers,
Antoni
 
1. Create a table with a field called Customer ID which is of type Long Integer.
2. Create a record in that table with a value of 999 in the Customer ID field.
3. Change the Custoemr ID field type to AutoNumber.
4. Delete the record created in step 2.

Auto numbers will then be created from 1000 up - they won't be random though, there'll be sequential, but they will be unique.

Hope this helps.

[pc2]
 
what are you going to do when you have 9999 customers?

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top