Print Page | Close Window

New Record Return for update

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=952
Printed Date: 28 March 2026 at 10:23pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: New Record Return for update
Posted By: jdumayas
Subject: New Record Return for update
Date Posted: 12 March 2003 at 8:58am
Hello,

I've set up a form for users to add records to a DB. Adding new records is a multiple step process where I have users insert general information first, then the users would add more information (to a different table) in another form. How do I have the DB return the record for the general information that was just entered. Since it would be a new number that is generated from the primary key?

All of the examples I have seen for people to update, lists every record available in the DB. That can get kinda cumbersome for the user to have to search for a record they have just entered. Any assistance would be greatly appreciated. Thanks, Jeremy



Replies:
Posted By: Bunce
Date Posted: 12 March 2003 at 3:37pm

If you're using SQL Server or Access 2000 (with the JET4 Driver), you can use:

SELECT @@Idenity after the initial insert to return the ID of the newly inserted record:
http://www.adopenstatic.com/Experiments/FastestAutonumber.asp - http://www.adopenstatic.com/Experiments/FastestAutonumber.asp

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net