This topic is locked

is there a way to auto advance to the next record...

12/27/2011 5:36:51 PM
ASPRunnerPro General questions
author

Is there a way to set up an event to auto advance to the next record after I hit the Save button? While on the edit page? Thanks.

Sergey Kornilov admin 12/29/2011

In AfterEdit event you need to determine the next record ID and redirect user to that record edit page.
Sample code (assuming that ID is the key column and database is MS Access)

sql = "select top 1 ID from TableName where ID > " & keys("ID") & " order by ID "

set rs = CustomQuery(sql)

if not rs.eof then

response.redirect "tablename_edit.asp?editid1=" & rs("ID")

end if