| | |
|
|
|
Filter recordset on form field |
| message from Matt Houldworth on 19 Jul 2004 |
Hi all
I have a form field that contains id numbers out of database - format
1,2,6,8 etc depending on what user chooses
I want to filter a recordsets id based on that form field to show only the
field id's in the form field and then do a repeat region to show the
recordset
I have the field working, and have a recordset setup filtering as follows
SELECT *
FROM propertytype
WHERE id = MMColParam
where MMColParam is Request.Form("id") where id is the name of the field
this seems to work in Dreamweaver however the repeat region only shows the
first record in the asp page
any ideas anone?
Thanks for help in advance
Matt Houldsworth
Digitalquill
|
| Matt Houldworth replied to Matt Houldworth on 19 Jul 2004 |
I have it working using the IN command
so i now have it so that it filters off form field (see below)
you have to press return key in the form field for it to filter, how can i
make this filter onLoad based on the form field as i want this hidden
Matt Houldsworth
Digitalquill
<%
Dim housetype__MMColParam
housetype__MMColParam = "1"
If (Request.Form("houseid") <> "") Then
housetype__MMColParam = Request.Form("houseid")
End If
%>
<%
Dim housetype
Dim housetype_numRows
Set housetype = Server.CreateObject("ADODB.Recordset")
housetype.ActiveConnection = MM_vbhousetypes_STRING
housetype.Source = "SELECT housetype, id, urlvalue FROM propertytype WHERE
id IN (" + Replace(housetype__MMColParam, "'", "''") + ")"
housetype.CursorType = 0
housetype.CursorLocation = 2
housetype.LockType = 1
housetype.Open()
housetype_numRows = 0
%>
"Matt Houldworth" <matthew@-NOSPAM-digitalquill.co.uk> wrote in message
news:cdgdth$8sc$1@forums.macromedia.com...
|
| Les Matthews replied to Matt Houldworth on 19 Jul 2004 |
If you are going to use Request.Form, then the form must be submitted - else
the variable does not exist. Maybe I don't understand your question, but why
would you want to display filtered results before the user has made a filter
selection - i.e. 1, 2, 6, 8, etc.?
Also you should not use a possible real value as your default value. You
should change
housetype__MMColParam = "1"
to
housetype__MMColParam = "0"
"Matt Houldworth" <matthew@-NOSPAM-digitalquill.co.uk> wrote in message
news:cdglh1$ilc$1@forums.macromedia.com...
|
|
Archived message: Filter recordset on form field (Macromedia Dreamweaver)