Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting session variables 1

Status
Not open for further replies.

smurf01

IS-IT--Management
Joined
Jul 6, 2002
Messages
470
Location
GB
Hi, I wonder if anyone can help me. I have a form that I use to filter data based on Account Managers names,Then on another page I display the results. My question is can i create a session variable based on the name selected on the search form and if so how would i go about it ??

Regards

Paul
 
After you submit the form, I assume you go to another page, enter the following line of code: (it has to be an .asp page)

Session("AccountManager")=Request("AccountManagers")

You can then reference this session variable like this:

Hello <%=Session(&quot;AccountManager&quot;)%>

I hope that helped, let me know if you need more help.

Steve
 
steve,
I have never really done anything on session variables this is why i am struggling, here is what i am trying to do.

On my form I have a combo box(cmbACname)the user selects their name from the list and then submits the form. this then goes to a detail page where the data is shown dependent on that person's name. If there are no records to show I have set a &quot;show if recordset is empty&quot; region which displays the message (&quot; there is no outstanding data for&quot;)and what I would like to do is display the name from the form after the text e.g.

&quot;there is no outstanding data for : Paul&quot;

I hope that makes things clearer [ponder]

Regards

Paul
 
Well, that even easier. You don't need a Session variable for that.

Do that:

there is no outstanding data for <%=Request(&quot;cmbACname&quot;)%>

This should work.

Steve
 
So you must already grab your name for your recordset. In code view, this will be assigned at the top of your page as something like:

rsYourRecordsetName__MMColParam

all you need do is use asp to output that to the screen.

again in code view, your line:

&quot;there is no outstanding data for : Paul&quot;

needs to be

&quot;there is no outstanding data for : <%=rsYourRecordsetName__MMColParam%>&quot;

No need for session variables, if that doesnt make sense post your entire details page code

Cheech

[Peace][Pipe]
If you don't stand up for something, you'll fall down. Toke it Easy.
Howard Marks. Visit the forum at
 
Steve/Cheech,
Thanks for your replies, I did manage to work it out using the following code

Code:
<%Response.Write(Request.Form(&quot;cmbACname&quot;))%>

but I had to go to a meeting and could not get back in time to tell you I had solved it, anyway Thanks a Lot

:-D [2thumbsup] :-D

Regards

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top