This topic is locked
[SOLVED]

 lookup wizard where clause

8/30/2012 10:31:34 AM
ASPRunnerPro General questions
S
sbodde author

Hi,
I can use session variables (created in before display event) in the where clause of a lookup wizard in an add page, but the session variable stays alive in spite of session.contents.remove (in after record added event).

When I want to add a new record for a different customer, the old session variable is still active which gives me wrong results in the lookup wizard (obvious).
Can I use the record value in the where clause in stead of making a session variable of it? So far, I can retrieve the record in the before display event, but I cannot get the where clause correct so the correct data displays in the lookup wizard. Please advise. Should I use the default value option maybe?
Sybrand

Sergey Kornilov admin 8/30/2012

Sybrand,
try to use another event rather than BeforeDisplay to set this session variable. It looks like you delete this variable and set it again before page loaded.

G
gdmacdo 8/31/2012

You could place a statement in the "Process Record Values" event like:

session("My_StudentID")=values("StudentID")
Then, your where statement in your lookup could be:
"StudentLookup = '" & session("My_StudentID") & "'"
I am putting spaces in between the quotes so you can tell where the single and double quotes are located
"StudentLookup = ' " & session("My_StudentID") & " ' "



Hi,
I can use session variables (created in before display event) in the where clause of a lookup wizard in an add page, but the session variable stays alive in spite of session.contents.remove (in after record added event).

When I want to add a new record for a different customer, the old session variable is still active which gives me wrong results in the lookup wizard (obvious).
Can I use the record value in the where clause in stead of making a session variable of it? So far, I can retrieve the record in the before display event, but I cannot get the where clause correct so the correct data displays in the lookup wizard. Please advise. Should I use the default value option maybe?
Sybrand

S
sbodde author 9/4/2012

Sergey, Greg,
that helped a lot. Problem solved by using "Process Record Values" event.

Thank you both very much.

Sybrand

event>

You could place a statement in the "Process Record Values" event like:

session("My_StudentID")=values("StudentID")
Then, your where statement in your lookup could be:
"StudentLookup = '" & session("My_StudentID") & "'"
I am putting spaces in between the quotes so you can tell where the single and double quotes are located
"StudentLookup = ' " & session("My_StudentID") & " ' "