<% Function Query2HTMLSelect(DrpDn, sValue) 'Finds the sValue and Change it to selected Query2HTMLSelect = Replace(DrpDn, "Value=" & sValue, "Value=" & sValue & " Selected") End Function Function Query2HTML(QueryList) 'This function returns a Select Dropdown for Forms 'It also assumes that Fields(0) & Fields(1) are the selections Dim SQL, RS, DrpDn Set RS = Server.CreateObject("ADODB.RecordSet") Select Case QueryList Case "Products" SQL = "SELECT * FROM CATEGORIES WHERE CatID LIKE 'P%' ORDER By CatID" Case "Country" SQL = "SELECT * FROM COUNTRIES ORDER By cnID" Case "Category" SQL = "SELECT * FROM CATEGORIES WHERE CatID LIKE 'C%' OR CatID LIKE 'X%' ORDER By CatID" End Select If SQL <> "" Then RS.Open SQL, DSN, adOpenForwardOnly, adLockReadOnly 'Now populate the Select List If Not RS Is Nothing Then If Not RS.EOF and Not RS.BOF Then DrpDn = "" & vbCRLF Application(QueryList) = DrpDn End If End If End If Set RS = Nothing End Function %>