I've moved onto a new search...

I have ~6 fields or so that I would like to use as search criteria. The thing about this that's different is that "they" want to do range of things (from * to *) rather than a simple choose from a list menu.


<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
SQL = "SELECT * FROM boats"
if strBoat &lt;&gt; "" then
wheresql = wheresql & " AND (fldPS='" & trim(strBoat) & "')"
end if
if strMinLength &lt;&gt; "" then
wheresql = wheresql & " AND (fldSize BETWEEN (strMinLength) AND (strMaxLength))"
end if
if strType &lt;&gt; "" then
wheresql = wheresql & " AND (fldType='" & trim(strType) & "')"
end if
if strMinYear &lt;&gt; "" AND strMaxYear &lt;&gt; "" then
wheresql = wheresql & " AND (fldYear BETWEEN (strMinYear) AND (strMaxYear))"
end if
if strPower &lt;&gt; "" then
wheresql = wheresql & " AND (fldPower='" & trim(strPower) & "')"
end if
if strMinPrice &lt;&gt; "" AND strMaxPrice &lt;&gt; "" then
wheresql = wheresql & " AND (fldPrice BETWEEN (strMinPrice) AND (strMaxPrice))"
end if
if strMan &lt;&gt; "" then
wheresql = wheresql & " AND (fldMfg='" & trim(strMan) & "')"
end if
if strManLetter &lt;&gt; "" then
wheresql = wheresql & " AND (fldMfg LIKE '(strManLetter)*')"
end if

Now, I realized that I need to put
<BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
if wheresql &lt;&gt; "" then
wheresql = Right(WhereSQL, len(WhereSQL)-4)
SQL = SQL & " WHERE" & wheresql
end if
rsRec.Open SQL, objRec, 3, 3
at the end because this trims the " And" from var wheresql if it's at the beginning of the string....

The error I'm getting is "Too few parameters. Expected 2". Why do I get the strange feeling that I've messed up my "quotes" and 'single quotes'?


Dave Han - webmaster@goboatingamerica.com
- Oh we just so love coding...
Go Boating America.com - Official Home of Sea and Go Boating Magazines.
Everything related to boating...and then some. Visit goboatingamerica.com