Forums

This topic is locked

Filter based on Session Variable

Posted 10 May 2002 01:47:26
1
has voted
10 May 2002 01:47:26 Jeff H posted:
Sorry I am bit new to this part of UD, bear with me.

I have a Access Database which I connect via DSN to. I created a report page which pulls from the table(REGINFO) showing all records (repeat region is used). I now have a session variable that is the persons name (First Name Last Name) I have another table(TourSchedule) that contents a field that has the same (First Name Last Name). I want to filter the items in the list based on this variable.

My current SQL statement
SELECT DISTINCT *
FROM REGINFO, TourSchedule
WHERE TourSchedule.Compaqcontact = 'MMColParam'

Current Variables
MMColParam = Session("svUserName"

svUserName = (First Name Last Name) as mention above.

I am missing something here as, the person is still viewing ALL the records in the Table. I hope I got this right and you have enough information to help resolve the problem. Please assist. Thanks!

Replies

Replied 17 May 2002 17:44:54
17 May 2002 17:44:54 David Hayes replied:
I think your problem might be that your not giving any value to your session variable.

Instead of using this:
<pre id=code><font face=courier size=2 id=code>svUserName = (First Name Last Name)</font id=code></pre id=code>

Use this:
<pre id=code><font face=courier size=2 id=code>Session("svUserName" = (First Name Last Name)</font id=code></pre id=code>
I hope this helps!

Reply to this topic