Okay, but what is the definition of "last record". Databases do *NOT* have any inherent concept of record ordering. The only way you define a "first record" or "nth record" or "last record" is to use an ORDER BY in your SQL query.
So I'm going to make some assumptions, as you didn't fill me in with more details:
-- I assume that your query that gets the records is doing "ORDER BY xyzID"
-- I assume that in your <form> you have stored that
xyzID into some field
. . (presumably via <input type="hidden" name="id" value="<%=RS("xysID"%>" /> or equivalent)
So it's pretty easy:
On the page that the <form> submits to you will get all the form fields:
Code:
<%
id = Request("id")
name = Request("name")
framitz = Request("framitz")
' update the record with the given id
SQL = "UPDATE table SET name = '" & name & "', framitz='" & framitz & "' WHERE xysID = " & id
conn.Execute SQL
Set RS = conn.Execute( "SELECT MAX(xysID) FROM table" )
maxid = RS(0)
RS.Close
If maxid = id Then Response.Redirect "youAreDone.asp"
...
%>
You see? I am using MAX(xysID) because that matches the "ORDER BY xysID" that was used to populate the <form>.
If you showed me more details of your situation, there might be a slightly different answer, but it would be close to the same.