Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Autonumbers


Message #1 by IT@g... on Tue, 16 Jul 2002 16:10:30
Is it possible to select and copy the Autonumber and use this number in 
another field for the same record in the same table?

For example if my Autonumber is 2 can Access automatically capture this 
number and put it in another field in the same table.

Also is there a limit on how many foreign keys can be linked to a primary 
key?
I have a table that has an Autonumber (Primary Key) and a lot of tables 
that are unique in their categories and therefore belong in separate 
tables but need to be related to my Main table.
Message #2 by joe.dunn@c... on Tue, 16 Jul 2002 16:23:52 +0000
Yes - you can use data from an Autonumber field elsewhere in your table -
it is a long integer
The limit on indexes per table is 32 (they may each be made up of up to 10
fields) - can't see a limit on foreign keys



                                                                                           
                    IT@g...                                                        
                    les.org.uk             To:     "Access" <access@p...>          
                                           cc:                                             
                    16/07/2002             Subject:     [access] Autonumbers               
                    16:10                                                                  
                    Please respond                                                         
                    to "Access"                                                            
                                                                                           
                                                                                           




Is it possible to select and copy the Autonumber and use this number in
another field for the same record in the same table?

For example if my Autonumber is 2 can Access automatically capture this
number and put it in another field in the same table.

Also is there a limit on how many foreign keys can be linked to a primary
key?
I have a table that has an Autonumber (Primary Key) and a lot of tables
that are unique in their categories and therefore belong in separate
tables but need to be related to my Main table.




*************************************************************************

This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named
recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return:
you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an
authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions
expressed are those of the individual author.

The CIS marketing group, which is regulated for Investment Business by the Financial Services Authority, includes:
Co-operative Insurance Society Limited Registered in England number 3615R - for life assurance and pensions
CIS Unit Managers Limited Registered in England and Wales number 2369965  - for unit trusts and PEPs
CIS Policyholder Services Limited Registered in England and Wales number 3390839 - for ISAs and investment products bearing the CIS
name
Registered offices: Miller Street, Manchester M60 0AL   Telephone  0161-832-8686   Internet  http://www.cis.co.uk   E-mail
cis@c...

CIS Deposit and Instant Access Savings Accounts are held with The Co-operative Bank p.l.c., registered in England and Wales number
990937, P.O. Box 101, 1 Balloon Street, Manchester M60 4EP, and administered by CIS Policyholder Services Limited as agent of the
Bank.

CIS is a member of the General Insurance Standards Council

CIS & the CIS logo (R) Co-operative Insurance Society Limited

********************************************************************************
Message #3 by "Alan Edwards" <alan.edwards@n...> on Tue, 16 Jul 2002 16:39:00
It doesnt sound to me like you need to have a second field with the 
autonumber copied into, why not just join your other tables via your 
primary key, ie. the autonumber? Unless Im missing something of course!




> Is it possible to select and copy the Autonumber and use this number in 
a> nother field for the same record in the same table?

> For example if my Autonumber is 2 can Access automatically capture this 
n> umber and put it in another field in the same table.

> Also is there a limit on how many foreign keys can be linked to a 
primary 
k> ey?
I>  have a table that has an Autonumber (Primary Key) and a lot of tables 
t> hat are unique in their categories and therefore belong in separate 
t> ables but need to be related to my Main table.
Message #4 by "Wesley Kendrick" <wez.k@n...> on Wed, 17 Jul 2002 16:52:25 +0100
Hi, you can do this with an Update Query.
Create a Query based on the table and including the Autonumber field and the
field you want to modify.
Change the Query type to 'Update Query' - you should find the button for
this on the toolbar on the left of the large red exclamation.
In the 'Update to' row for the field you want to update, type the name of
the Autonumber field enclosed in square brackets.
When you run the query, every row in the table will be updated, so if you
want to be selective you will need to apply some criteria.
Hope this helps.
Regards, Wesley Kendrick

----- Original Message -----
From: <IT@g...>
To: "Access" <access@p...>
Sent: Tuesday, July 16, 2002 4:10 PM
Subject: [access] Autonumbers


> Is it possible to select and copy the Autonumber and use this number in
> another field for the same record in the same table?
>
> For example if my Autonumber is 2 can Access automatically capture this
> number and put it in another field in the same table.
>
> Also is there a limit on how many foreign keys can be linked to a primary
> key?
> I have a table that has an Autonumber (Primary Key) and a lot of tables
> that are unique in their categories and therefore belong in separate
> tables but need to be related to my Main table.
>

Message #5 by IT@g... on Wed, 17 Jul 2002 17:05:32
You are right about just only using the one autonumber but I was afraid 
that if I did this there would be about 5 or more tables related to the 
one autonumber.  And while this may work initially what would the long 
term hold in store for my database efficiency?

Thanks for your comments.





> 
I> t doesnt sound to me like you need to have a second field with the 
a> utonumber copied into, why not just join your other tables via your 
p> rimary key, ie. the autonumber? Unless Im missing something of course!

> 

> 
>>  Is it possible to select and copy the Autonumber and use this number 
in 
a> > nother field for the same record in the same table?

> > For example if my Autonumber is 2 can Access automatically capture 
this 
n> > umber and put it in another field in the same table.

> > Also is there a limit on how many foreign keys can be linked to a 
p> rimary 
k> > ey?
I> >  have a table that has an Autonumber (Primary Key) and a lot of 
tables 
t> > hat are unique in their categories and therefore belong in separate 
t> > ables but need to be related to my Main table.
Message #6 by "Gerald, Rand" <RGerald@u...> on Wed, 17 Jul 2002 11:01:03 -0500
There is one caveat - the master table has a data type of AutoNumber 
while
the linked tables have a data type of Long.  They should not all be
AutoNumber.

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: IT@g... [mailto:IT@g...]
Sent: Wednesday, July 17, 2002 12:06 PM
To: Access
Subject: [access] Re: Autonumbers

You are right about just only using the one autonumber but I was afraid
that if I did this there would be about 5 or more tables related to the
one autonumber.  And while this may work initially what would the long
term hold in store for my database efficiency?

Thanks for your comments.





>
I> t doesnt sound to me like you need to have a second field with the
a> utonumber copied into, why not just join your other tables via your
p> rimary key, ie. the autonumber? Unless Im missing something of 
course!

>

>
>>  Is it possible to select and copy the Autonumber and use this 
number
in
a> > nother field for the same record in the same table?

> > For example if my Autonumber is 2 can Access automatically capture
this
n> > umber and put it in another field in the same table.

> > Also is there a limit on how many foreign keys can be linked to a
p> rimary
k> > ey?
I> >  have a table that has an Autonumber (Primary Key) and a lot of
tables
t> > hat are unique in their categories and therefore belong in 
separate
t> > ables but need to be related to my Main table.

  Return to Index