Click to See Complete Forum and Search --> : How to remove blanks in a list menu???


ncozzolino
02-24-2005, 08:36 AM
One of my tables is used for two purposes so there are blanks in the column I'm filtering. I tried using an IF statement but it still put the blanks in the list menu. Any idea how to remove the blank items???

My code:


<%
dbConn.Open strConnect
strSQL = "SELECT * FROM mrkData ORDER by fullname"
objRS.Open strSQL, dbConn
If Not objRS.EOF and Not objRS.BOF Then
%>
<SELECT NAME="qaSelect" size="1">
<OPTION></OPTION>
<% ' Loop through names
Do Until objRS.EOF
iRecord = objRS.Fields("id").Value
Response.Write "<option value=" & iRecord & ">"
If objRS.Fields("fullname")= "" then
objRS.MoveNext
Else
Response.Write Trim(objRS.Fields("fullname"))
End if
Response.Write "</option>" & vbCrLf

' Move to next record
objRS.MoveNext
Loop
%>
</SELECT>
<%
End If

objRS.close
dbConn.close
%>

ncozzolino
02-24-2005, 09:10 AM
Figured it out.


do until objRS.eof
if objrs.fields("fullname")<>"" then
iRecord = objRS.Fields("id").Value
Response.Write "<option value=" & iRecord & ">"
Response.Write Trim(objRS.Fields("fullname"))
Response.Write "</option>"
else
end if
objRS.movenext
loop



or

SELECT * FROM mrkdata WHERE fullname<>'' ORDER BY fullname