Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

IF THEN - Help Please

LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

Hope someone can help me with this one....

My Search page has a drop down menu with 5 values

I need to use a IF THEN statement between recordsets on my results page. I
have 5 record sets.

So something like

<% If Request("due2")=e THEN %>

recordeset1

<% Else %>

<% If Request("due2")=k THEN %>

recordset2

etc........

I've tried to create this but can't get it to work and wonder if someone can
give an example of the code required.

Thanks in advance

Andy




TOPICS
Server side applications

Views

274
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

Use:

<%
If Request("due2")=e THEN

recordeset1

End If
%>

<%
If Request("due2")=k THEN

recordset2

End If
%>

etc........

That should work.

I would also specify Request.Querystring or Request.Form intead of just
Request depending on whether you are using GET or POST.

Pat.


"Andy" <me@work.com> wrote in message
news:egnol8$b1t$1@forums.macromedia.com...
> Hope someone can help me with this one....
>
> My Search page has a drop down menu with 5 values
>
> I need to use a IF THEN statement between recordsets on my results page. I
> have 5 record sets.
>
> So something like
>
> <% If Request("due2")=e THEN %>
>
> recordeset1
>
> <% Else %>
>
> <% If Request("due2")=k THEN %>
>
> recordset2
>
> etc........
>
> I've tried to create this but can't get it to work and wonder if someone
> can give an example of the code required.
>
> Thanks in advance
>
> Andy
>
>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

Thanks for that Pat

I've realised that when I do this, it messes up the recordset values on the
page because these are based on the first recordset
<%=(RSInCal.Fields.Item("Serial_no").Value)%> i.e. RSInCal, the other
recordets are named as RSInCal2, RSinCal3, etc.

Maybe it's easier to have five separate results pages, one for each dropdown
value. This seems a little long winded so if anyone can suggest a solution,
I'd be very grateful

Andy






"Pat Shaw" <pat@nomail.com> wrote in message
news:egnpk4$c0t$1@forums.macromedia.com...
> Use:
>
> <%
> If Request("due2")=e THEN
>
> recordeset1
>
> End If
> %>
>
> <%
> If Request("due2")=k THEN
>
> recordset2
>
> End If
> %>
>
> etc........
>
> That should work.
>
> I would also specify Request.Querystring or Request.Form intead of just
> Request depending on whether you are using GET or POST.
>
> Pat.
>
>
> "Andy" <me@work.com> wrote in message
> news:egnol8$b1t$1@forums.macromedia.com...
>> Hope someone can help me with this one....
>>
>> My Search page has a drop down menu with 5 values
>>
>> I need to use a IF THEN statement between recordsets on my results page.
>> I have 5 record sets.
>>
>> So something like
>>
>> <% If Request("due2")=e THEN %>
>>
>> recordeset1
>>
>> <% Else %>
>>
>> <% If Request("due2")=k THEN %>
>>
>> recordset2
>>
>> etc........
>>
>> I've tried to create this but can't get it to work and wonder if someone
>> can give an example of the code required.
>>
>> Thanks in advance
>>
>> Andy
>>
>>
>>
>>
>
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

You need to give us more information about your search page and what your
results page is trying to achieve.
You only need one results page...
What you might beed to do is write some code to create a single recordset of
results depending on what was searched for.
If you can explain what you are trying to achieve, a solution could be
easier to offer up :)
Cheers,
Rob
http://robgt.com/ [Tutorials and Extensions]
Firebox stuff: http://robgt.com/firebox
Skype stuff: http://robgt.com/skype
SatNav stuff: http://robgt.com/satnav


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

LATEST
Hi Rob
I have created a number of results pages but i know that this isn't the
right way to go about it.

What i have is a dropdown list on my search page. This has about 5 or 6
values, each corresponding to the 'status' field in my database.
The results page filters the database based on the 'status', so for
instance, from the dropdown menu i would select 'all products with a status
of a' The results page would simply display all of the products with a
status of a

Initially, i had a recordset for each of the status's, i.e. select from
database where status is a
I tried the if then statement between each of the recordsets, but then
realised that the actual values displayed on the page are, of course,
associated with the recordset.
This would mean a hell of a lot more if then statemants.

I'd love to know how i could use a sinlge recordset depending on what was
searched for - that would be great.

Hope this makes more sense!


Regards
Andy



"RobGT" <rob@lighthouseuk.removeme.net> wrote in message
news:egnt35$g15$1@forums.macromedia.com...
> You need to give us more information about your search page and what your
> results page is trying to achieve.
> You only need one results page...
> What you might beed to do is write some code to create a single recordset
> of results depending on what was searched for.
> If you can explain what you are trying to achieve, a solution could be
> easier to offer up :)
> Cheers,
> Rob
> http://robgt.com/ [Tutorials and Extensions]
> Firebox stuff: http://robgt.com/firebox
> Skype stuff: http://robgt.com/skype
> SatNav stuff: http://robgt.com/satnav
>


Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines