Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two interesting problems! Need help, Maury!

Status
Not open for further replies.

chassid

MIS
Aug 27, 2000
58
US
All,

I've got two problems. The first problem is that I am trying to populate a listbox with values from a database, but without them repeating. I have 50 south and 50 north and would like the listbox to just list 1 south and 1 north. With the code that I have generated I get 50 south ano none of the north. Here is that piece of code:

Set objDC = Server.CreateObject("ADODB.Connection")
objDC.open("act1")

Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset")
rsGlobalWeb.Open "act1", objDC, Search

Search = "Select DISTINCT Criteria from act1"

If NOT rsGlobalWeb.BOF Then%>

<form method=&quot;Post&quot;>
<Select Name = &quot;Criteria1&quot;>
<Option Selected>--Select Criteria--
(...)
Now, the second problem is I am trying to assign a variable to what fields will populate the listbox. So if the user chooses chapter, committee, or directors the listbox will be populated with the fields under these. The code I need help with is this:

<%While NOT rsGlobalWeb.EOF %>
<Option =&quot;<%= rsGlobalWeb.Fields(&quot;id&quot;)%> &quot;><%= rsGlobalWeb.Fields(&quot;&criteria&&quot;)%></option>

The &criteria& above is the variable, which can be any of the values chosen by the user. I need to know the correct syntax to do this.

If anyone can help me with one or both of these problems I will greatly appreciate it.

Daniel

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top