Forums
This topic is locked
How to add "All" option to a search drop-down menu
Posted 08 Aug 2001 14:20:20
1
has voted
08 Aug 2001 14:20:20 Gareth Davies posted:
I'm an Ultradev newbie, creating a site for a property leasing company. I'musing Ultradev 4 & Access 2000. Can someone please explain how I can add an
"All" option to drop down menus which are used to search for properties
available to rent? To clarify, my search form currently has two drop-down
menus, which the user must make his selections from:
Drop-down menu 1: Label: Select Region: Current value options are: City,
Suburbs, Other regions.
I'd like to add another option: All regions
Drop-down menu 2: Label: Select price range: Current options are: Up to
£1000, £1001 to £1500, Over £1500.
I'd like to add another option: All prices
I'm sure this is fairly simple, but I've searched lots of Ultradev websites etc,
and can't find any explanation of how to do it. I'd really appreciate
guidance in configuring this. Also, please clarify if this will only require
me to configure Ultradev, or will I also need to make some changes to my
Access database?
For further info, please also note (in case it's relevant!) that in my
Access database when these particular values are inserted in the main
"Properties" table of my database these particular values are also selected
from drop-down menu options, the values of which it gets by using a LookUp
from separate tables called: "Region" and "PriceRange". In Ultradev, I've
therefore set up the Search form's drop-down menus to get their labels and
values from these same "Region" and "PriceRange" tables - as opposed to the
main table, which is called "Properties". This works perfectly and my
searches return the relevant results, but if I want to add an "All" option,
do I need to set up the drop-down menus differently?
I hope I've explained this all clearly! Any assistance greatly appreciated!
Replies
Replied 08 Aug 2001 14:24:38
08 Aug 2001 14:24:38 Joel Martinez replied:
you must add a list item that has a wildcard value "*"
then make sure that any checks against that field are changed to "LIKE" instead of "="
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
then make sure that any checks against that field are changed to "LIKE" instead of "="
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
Replied 09 Aug 2001 17:23:05
09 Aug 2001 17:23:05 Gareth Davies replied:
Thanks Joel. I actually found the answer already by downloading the example "SelectAll" pages from Jules' site (www.charon.co.uk) and discovered it's extremely simple. All I found I needed to do was select the particular Dynamic list, select the "List values" button on property inspector, and add an extra item label (eg. All Regions) with a value of %. Works a dream!
I note you said to use the * wildcard, but % has worked. What's the difference?
I also haven't looked at the "LIKE" bit as it seems to work fine as is (but let me know if I'm missing something here!).
While I appreciate this tweak will be very obvious to those with SQL experience, for a newbie like me I'm really surprised that the "Select all" option (which I'd have thought is a common requirement on search forms) isn't covered in the onboard Ultradev help notes, and was extremely hard to track down by surfing other UD sites. Oh well, God bless newsgroups/forums for coming to the rescue once again!!
I note you said to use the * wildcard, but % has worked. What's the difference?
I also haven't looked at the "LIKE" bit as it seems to work fine as is (but let me know if I'm missing something here!).
While I appreciate this tweak will be very obvious to those with SQL experience, for a newbie like me I'm really surprised that the "Select all" option (which I'd have thought is a common requirement on search forms) isn't covered in the onboard Ultradev help notes, and was extremely hard to track down by surfing other UD sites. Oh well, God bless newsgroups/forums for coming to the rescue once again!!
Replied 09 Aug 2001 23:56:16
09 Aug 2001 23:56:16 Joel Martinez replied:
well, the difference between the two wildcards is simply in the platform... usually the "%" is for SQL Server, and the "*" is for access.
I've used them interchangably in the past, but there have been times where I get an error with the % on access...
but if it's working, go right ahead <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"
I've used them interchangably in the past, but there have been times where I get an error with the % on access...
but if it's working, go right ahead <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Joel Martinez
----------
set rs = conn.execute("SELECT answer FROM brain WHERE question = "& forumPost &"