Forums

This topic is locked

Dynamic List Menu

Posted 31 Dec 2001 15:11:43
1
has voted
31 Dec 2001 15:11:43 Russell Marshall posted:
I have created a Dynamic list box at www.motorcredituk.co.uk/search.asp
The problem I have is that it lists multiple entries for car manufacturer.

Is it possible to make the list box display just one entry for each manufacturer?

Replies

Replied 01 Jan 2002 15:28:54
01 Jan 2002 15:28:54 Viktor Farcic replied:
Use GROUP BY in your SQL statement.
Something like: SELECT Manufacturer FROM NameOfTheTable GROUP BY Manufacturer

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I have created a Dynamic list box at www.motorcredituk.co.uk/search.asp
The problem I have is that it lists multiple entries for car manufacturer.

Is it possible to make the list box display just one entry for each manufacturer?


<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Viktor Farcic

TalkZone Manager

Edited by - vfarcic on 01 Jan 2002 15:30:38
Replied 02 Jan 2002 00:08:07
02 Jan 2002 00:08:07 Russell Marshall replied:
Thanks Viktor but I still cannot get it to work.
The following is the code from the page.

&lt;select name="mnuMake"&gt;
&lt;%While (NOT RS_Search.EOF)%&gt;
&lt;option value="&lt;%=(RS_Search.Fields.Item("make".Value)%&gt;" &gt;&lt;%=(RS_Search.Fields.Item("make".Value) %&gt;&lt;/option&gt;
&lt;% RS_Search.MoveNext()Wend If (RS_Search.CursorType &gt; 0) Then RS_Search.MoveFirst Else RS_Search.Requery End If%&gt;
&lt;/select&gt;

Where do I enter GROUP BY.

Your further assistance will be apreciated.

Thanks

Russell

Replied 02 Jan 2002 00:36:04
02 Jan 2002 00:36:04 Owen Eastwick replied:
Set up the Recordset used for the list/menu with an SQL statement like this:

RecordsetName.Source = "SELECT DISTINCT ManufacturerFieldName FROM YourTableName"

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 02 Jan 2002 00:53:19
02 Jan 2002 00:53:19 Russell Marshall replied:
Thanks Owen.

That works superbly.

Happy New Year and all the best.

Russell

Reply to this topic