Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoNumber 1

Status
Not open for further replies.

Esoteric

ISP
Feb 10, 2001
93
US
Is there a simple way to get the number of the record that was just added or is being added to the database.

Example:
-------------
I add a Job to the database via a form but I want to get the Job Number after its added. Seeing that the job number is an AutoNumber field how do I get it?

anyhelp is appreciated.
 
You can show the AutoNumber field on your form so that the number is displayed when the user starts typing. Does this answer the question?
Joe Miller
joe.miller@flotech.net
 
you can execute
(select count(*) from tableWhereYouWantToAppent) as x John Fill
1c.bmp


ivfmd@mail.md
 
or you can put as a source for a control the query John Fill
1c.bmp


ivfmd@mail.md
 
not exactly. First I am using ASP and there are many people entering jobs at different times so I cannot show the Number before the entry.

Secondly, the job numbers may not be sequential as data is purged from the system to the recordcount ideal will not work either.

What I want to know is this:
rs.AddNew <- When Adding a new record
JID = rs(&quot;JID&quot;) <- I tried this but there is not JID because the record has not been submitted yet.

Based on what I just said there is no easy way. Because its not submitted. Is there a way to RESERVE a record?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top