From: Len on
I may have posted this question to the wrong group, so here it goes again.

<% UVDescs(0)= "Art"
UVDescs(1)= "Biology"
UVDescs(2)= "French"
UVDescs(174)= "Phys Ed"
UVDescs(355)= "Readind"
UVDescs(356)= "Science"
UVDescs(357)= "Zoology"

If Session("PgSubject") = Request("PgSubject")
PgSubject = Session("PgSubject")
Else
PgSubject = Request("PgSubject")
Session("PgSubject") = Request("PgSubject")
End If

R = Trim("PgSubject")
S = "<Select Name = 'MyDropList' Size = '1'>" & vbCrLf
For N = 0 to 25
X = Trim(UVDescs(N))
S = S & "<Option Value = '" & X & "'"
If R = X Then S = S & " Selected"
S = S & ">" & X & "</Option>" & vbCrLf
Next
Response.Write S%>

In the above code when PgSubject contains an class,
(Example Phys Ed) I want MyDropList to go to that
class. If not to load the entire list of subjects.
When PgSubject has a class it it, it still displays
the first class.

I have struggled with this for over eleven days with this.

Thanks in Advance for your patience and Assistance

Len
From: McKirahan on
"Len" <Len(a)discussions.microsoft.com> wrote in message
news:26255F84-8B07-4D2F-AAEF-7A62538C4B21(a)microsoft.com...
> I may have posted this question to the wrong group, so here it goes again.
>
> <% UVDescs(0)= "Art"
> UVDescs(1)= "Biology"
> UVDescs(2)= "French"
> UVDescs(174)= "Phys Ed"
> UVDescs(355)= "Readind"
> UVDescs(356)= "Science"
> UVDescs(357)= "Zoology"
>
> If Session("PgSubject") = Request("PgSubject")
> PgSubject = Session("PgSubject")
> Else
> PgSubject = Request("PgSubject")
> Session("PgSubject") = Request("PgSubject")
> End If
>
> R = Trim("PgSubject")
> S = "<Select Name = 'MyDropList' Size = '1'>" & vbCrLf
> For N = 0 to 25
> X = Trim(UVDescs(N))
> S = S & "<Option Value = '" & X & "'"
> If R = X Then S = S & " Selected"
> S = S & ">" & X & "</Option>" & vbCrLf
> Next
> Response.Write S%>
>
> In the above code when PgSubject contains an class,
> (Example Phys Ed) I want MyDropList to go to that
> class. If not to load the entire list of subjects.
> When PgSubject has a class it it, it still displays
> the first class.
>
> I have struggled with this for over eleven days with this.

Change
R = Trim("PgSubject")
to
R = Trim(PgSubject)


From: ThatsIT.net.au on

"McKirahan" <News(a)McKirahan.com> wrote in message
news:FY2dnTdJJ9qxiMzVnZ2dnUVZ_sudnZ2d(a)comcast.com...
> "Len" <Len(a)discussions.microsoft.com> wrote in message
> news:26255F84-8B07-4D2F-AAEF-7A62538C4B21(a)microsoft.com...
>> I may have posted this question to the wrong group, so here it goes
>> again.
>>
>> <% UVDescs(0)= "Art"
>> UVDescs(1)= "Biology"
>> UVDescs(2)= "French"
>> UVDescs(174)= "Phys Ed"
>> UVDescs(355)= "Readind"
>> UVDescs(356)= "Science"
>> UVDescs(357)= "Zoology"
>>

ncxt line should be
If Session("PgSubject") = Request("PgSubject") then


>> If Session("PgSubject") = Request("PgSubject")
>> PgSubject = Session("PgSubject")
>> Else
>> PgSubject = Request("PgSubject")
>> Session("PgSubject") = Request("PgSubject")
>> End If
>>


as McKirahan pionted out

>> R = Trim(PgSubject)

>> R = Trim("PgSubject")
>> S = "<Select Name = 'MyDropList' Size = '1'>" & vbCrLf


also why not have
For N = 0 to UBound(UVDescs)


>> For N = 0 to 25
>> X = Trim(UVDescs(N))
>> S = S & "<Option Value = '" & X & "'"
>> If R = X Then S = S & " Selected"
>> S = S & ">" & X & "</Option>" & vbCrLf
>> Next
>> Response.Write S%>
>>
>> In the above code when PgSubject contains an class,
>> (Example Phys Ed) I want MyDropList to go to that
>> class. If not to load the entire list of subjects.
>> When PgSubject has a class it it, it still displays
>> the first class.
>>
>> I have struggled with this for over eleven days with this.
>
> Change
> R = Trim("PgSubject")
> to
> R = Trim(PgSubject)
>
>