Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA 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 February 9th, 2007, 02:59 AM
Authorized User
 
Join Date: Feb 2005
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default Refreshing AutoNumber

Hello all,

I have a question. Is there a way that when you delete a record in Access that the record attached to that auto number will get deleted and not the number itself? Basically what I want is to have the autonumber match how many records there are on that table.

Thanks,
Chris

 
Old February 9th, 2007, 08:39 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

No.

What are you using that number for and where? There are other ways to generate that number on forms and reports.

The autonumber should remain invisible to the user.

mmcdonal
 
Old February 10th, 2007, 04:22 AM
Authorized User
 
Join Date: Feb 2005
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Basically I am using this autonumber as my key. I was just wondering if when a record is deleted and the update query is ran to the other records related to this record that the autonumber whould then get assigned to the next record in the database.

 
Old February 12th, 2007, 08:40 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

No. Since it is meaningless data, it is not necessary to reassign a used key. It is also dangerous since child records may get appended to the wrong foreign key.


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Autonumber problem mankoti_mankoti2000 Access 6 August 29th, 2006 12:28 AM
AutoNumber causes problem. myself Classic ASP Professional 1 July 10th, 2006 03:35 PM
Help Needed in Autonumber! jamest Access VBA 3 February 3rd, 2005 03:52 PM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM
regarding Autonumber... MuthuAL Classic ASP Databases 2 December 8th, 2004 08:04 AM





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