In order to set a Session Variable to the just inserted record ID or "Identity" you can either modify the code or edit the extension itself. Here is what it should look like:
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = "SET NOCOUNT ON;" & MM_editQuery & ";SELECT @" & "@IDENTITY AS Ident"
Set rsLastIdent = MM_editCmd.Execute
if NOT rsLastIdent.EOF then
strLastIdent = rsLastIdent.Fields.Item("Ident").Value
' place the new record ID in a session variable called "NewID"
Session("NewID") = strLastIdent
end if
MM_editCmd.ActiveConnection.Close
Once you have modified the code like the red section above then Click on the + on the Data Bindings panel and select Session. Name it "NewID". It will contain the just created record ID for you to use in new recordsets or whatever! If you want to test it make the changes I mentioned, then create a blank page and drag the new Session variable you created called NewID on to the page. Refer to that page when the form you created submits and the record ID of the just submitted form will show on that page.
Enjoy!
Chris
Hello, my name is Chris von Nieda. Thanks for dropping by! I am a web developer, SEO and SEM. About 15 years ago I saw the Internet for the first time and was immediately hooked. Since then it has been my life, passion and hobby. 
Comments
Matt Bristow
RE: ASP.NET version
logan did you manage to crack this with ASP.NET? I am trying to do the same thing
Logan Couch
ASP.NET Version
Logan Couch
ASP.NET Version
Rip Munsterman
Pass Identity without Session Variable
I have seen numerous articles out there that claim session variables are “evil” because of they take up web server resources. So, after playing around with the code from DMX Zone, I made a couple alterations that eliminate the session variable and allows me to simply perform a “Request(“New_ID”)” on the page I have chosen as the redirect after submitting a record.
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = "SET NOCOUNT ON;" & MM_editQuery & ";SELECT @" & "@IDENTITY AS Ident"
Set rsLastIdent = MM_editCmd.Execute
if NOT rsLastIdent.EOF then
strLastIdent = rsLastIdent.Fields.Item("Ident").Value
end if
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?New_ID=" & strLastIdent
Response.Redirect(MM_editRedirectUrl)
End If
(strLastIdent is added to the MM_editRedirectURL variable)