OK, some background. What I need to do is pass an ID that is automatically generated (through a stored procedure) to a person search page. As I said, the ID is created through a stored procedure, and the query to insert this ID into the appropriate table is also created through a stored procedure. My problem is, that I finally got through all of the errors, and the person search page displays correctly, however there is no ID created! Can someone help me find out why.... Here&#039s all the code for the stored procedures:<BR><BR>generate ID:<BR>CREATE proc dbo.sp_generateID <BR>( @type int )<BR>AS <BR>declare @id integer<BR>begin<BR>select @id = -1<BR>if( @type = 25 )<BR>begin<BR>insert into gen_id values( getdate(), "PMO" )<BR>select @id = @@IDENTITY<BR>end<BR>select @id <BR>end<BR><BR>AddID procedure (executes the generate ID procedure):<BR>CREATE PROCEDURE sp_addID<BR>AS<BR>DECLARE <BR>@ID int,<BR>@ERROR int<BR><BR>BEGIN TRANSACTION addiD<BR>/*get id from the gen table*/<BR>EXECUTE sp_generateID 25<BR><BR>SELECT @ERROR = @@ERROR<BR><BR>IF @ERROR &#062; 0 RETURN 0<BR>/*insert into table*/<BR>INSERT INTO PPO(ID) VALUES<BR>(@ID)<BR><BR>SELECT @ERROR = @@ERROR<BR><BR>IF (@ERROR ) &#062; 0 <BR>BEGIN<BR>ROLLBACK TRANSACTION addID<BR><BR>END<BR>ELSE<BR>BEGIN <BR>COMMIT TRANSACTION addID<BR>END<BR><BR>function on my search.asp page:<BR>function Addnewinfo<BR><BR>dim cmd<BR>dim param<BR>dim inewid<BR><BR>&#039define store procedure to insert new record<BR>Set cmd = server.CreateObject("ADODB.Command")<BR><BR>cmd.Co mmandText = "sp_addID"<BR>cmd.CommandType = adCmdStoredProc<BR>cmd.ActiveConnection=applicatio n("connstring")<BR><BR>&#039return value<BR>Set param = cmd.CreateParameter("id", adInteger,adParamReturnValue, 4)<BR>cmd.Parameters.Append param<BR><BR>cmd.Execute <BR><BR>inewid=cmd.Parameters("id").Value<BR><BR>& #039store the values into session variables<BR>if inewid &#062; 0 then<BR>call cleanUp<BR><BR>session("Lngid")=inewid<BR>end if<BR><BR>Set param = Nothing<BR>Set cmd = Nothing<BR><BR>addnewinfo=inewid <BR>end function<BR><BR>The problem is, when I do a &#060;% Response.Write "ID= " + session("LngID")%&#062; on the search page, the session variable is empty.<BR><BR>Also, how do I code it so the function only executes once the user picks a person from the search page? I know I could use the JavaScript OnClick event, but from there I&#039m lost. I think I&#039ve been looking at this too long!<BR><BR>PLEASE HELP!!!<BR><BR>Thanks in advance<BR>