Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 23rd, 2005, 06:41 PM
Authorized User
Join Date: Dec 2005
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default AutoNumber sequence across multiple tables

is there a way that 2 separate tables can assign auto-serial numbers to records, using the same sequence? for example; table1 and table2 both assign autonumbers using the same sequence so that no one serial number is used in both tables.

Reply With Quote
  #2 (permalink)  
Old December 23rd, 2005, 10:19 PM
Friend of Wrox
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post

What type of relationship exists between the 2 tables?

Would it be possible to place the 2 tables in question on a 1:1 relationship and link them via Autonumber field as the PK in Table 1 and Number(long int) field as the FK in Table 2?


Reply With Quote
  #3 (permalink)  
Old December 24th, 2005, 02:45 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts

Hi Josh,

The simple answer is no. But the deeper issue is it sounds like you're attempting to use autonumbers in a way that assigns business meaning to them, which most folks who design a lot of DBs would recommend against. Autonumbers aren't intended to carry business meaning (i.e., serve as a data item, such as a meaningful serial number). They are designed to serve a logical function, not a semantic one. They provide a simple and consistent way of uniquely identifying a record in your database (primary key), but only your databse should ever need to know their value. They are generally hidden from the end user. Apologies if I'm off the mark here, but I suspect that what you are trying to do is something you wouldn't want to do, even if it were possible.



Reply With Quote
  #4 (permalink)  
Old December 24th, 2005, 03:32 AM
Friend of Wrox
Join Date: Jun 2003
Location: , , USA.
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts

Put another way...there is no good reason why one table in your db should care about, or even know, what the autonumber values in another table in your db are.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching multiple tables melkin Classic ASP Databases 0 March 10th, 2008 11:48 AM
Insert into Multiple Tables bmalex1 Beginning PHP 0 February 6th, 2006 12:45 PM
Importing Multiple files in Multiple tables Versi Suomi Access 6 June 1st, 2005 08:47 AM
Multiple Recordsets from Multiple Tables TSEROOGY Classic ASP Databases 2 December 28th, 2004 12:45 PM
multiple tables on one report? lanctotd Access 4 October 8th, 2003 03:41 PM

All times are GMT -4. The time now is 08:50 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.