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

Status
Not open for further replies.

mp3nick

Programmer
Feb 10, 2003
14
0
0
MY
Hi everybody
how can I make my own autonumber on my basis ? I mean I have MovieID in the table and TotalEpisodeNumber which if I join them together it will be unique, how to order access to join two field in table together to make unique increments integer for me ?

Thanks
 
Hello

Instead of creating a new autonumber, you can have both fields be your primary key. In design view, select the two fields MovieID & TotalEpisodeNumber and right click them as your primary keys for the new table. I am not sure if this is what you are looking for, but the result would be that each combination of MovieID and TotalEpisodeNumber would be unique.

For example the combination:
(MovieID) and (TotalEpisodeNumber)
("Footloose") and ("original")

can only be inserted in the table once as the combination is the primary key.


Another method that you could try is:
create a new table with a copy of the design of the original table (no data to start) and add an autonumber field. then copy your data from the original table over to the new table. The autonumber will automatically fill in as the data is copied over. You can then rename the table and check relationships etc.. This would be more difficult if there are many relationships already existing but it is still possible!

hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top