Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2005, 06:41 PM
Authorized User
 
Join Date: Dec 2005
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.
thanks
josh

 
Old December 23rd, 2005, 10:19 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Josh,
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?

Loralee

 
Old December 24th, 2005, 02:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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.

HTH,

Bob

 
Old December 24th, 2005, 03:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

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.






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.