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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirmation page

Status
Not open for further replies.

mmasuda

Technical User
Dec 28, 2004
35
US
Hi,
I have a form set up using dreamweaver. When the form data is submitted, it is added to an Access Database, which uses the autonumber function for this particular table.

I would like to display the particular number that is assigned to the new record just entered on a confirmation page. Is this a possibility?

thank you.

 
You could just :

select max id from table where user = username


[Peace][Pipe]
 
Look up '@@identity'

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
That will work until there are 2 entries in a short time....

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
What do you mean by this, johnwm? Not sure I understand.
 
<select max id from table where user = username>
will work fine as long as you have enforced that <user> is unique.
The @@identity solution is specifically designed for the purpose.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
The best way to accomplish this is to turn autonumber OFF and place the value in it yourself with something like this:

The first thing you do is create a recordset with just this SQL Statement:
'Select MAX(ID)+1 AS <your id field> FROM <your table>'
put the results in a session:
Session("<name of your session>") = <results of your query, should be a numeric value>
Then put the session value in a hidden field and reference it to insert into the ID field when you insert your record.
 
and if you have 2 users visit the page at about the same time (eg. niether has updated the database but both are on the page that has just grabbed the MAX id) they will both then be assigned the same "unique" id

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top