This topic is locked

Record ID

2/17/2005 1:47:22 PM
ASPRunnerPro General questions
W
WeB author

I want to create a Record ID field that automatically updates to the next number when I click add. Any Ideas?

Pete M 2/17/2005

Hi,
The easiest way is to make the field an 'Autonumber' type (in Access, or whatever the corresponding type is for your db). Then make sure that this field is NOT included on the 'add' form, and the numbers increment automatically.

W
WeB author 2/17/2005

Thanks Pete
It didnt work when I just hid it (DUH)( <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=3412&image=1&table=forumreplies' class='bbcemoticon' alt='<<' /> ). It did work when I removed it from the page.

500181 2/28/2005

Hi, I downloaded the trial version and I'm using it on an existing database. I need to know if there is a way of reading the values and incrementing them by one. I can not do it with access because the database isn't designed that way. Can anybody help?
Thanks,

Brian

Sergey Kornilov admin 2/28/2005

Brian,
you can do something like select max(id)+1 as newid right before inserting a new record.