View Single Post
Old 08-06-2000, 03:55 PM   #2
UncaDanno
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Post

Assuming you have all these controls in a form, you could do the following for the select/text duo:

As you process the "request.form" fields, you could build your SQL statement for accessing Access like this:
strSQL = "select (whatever you're going to select) from (whatever the table name is) where " & request.form("search") & " = """ & request.form("criteria") & """"

Yeah. There's those dang triple- and quad-quotes again.


For the checkboxes, I'm not sure about what you're trying to do, but here's a stab at it.

Are you storing whether the user checked a box to the database? Easiest way to do this would be to use a 1 or 0 like parksie suggested. Then, when you retrieved the data, you could "check" a box like this:

Dim strChk629
Dim strChk691

strChk629 = "" (just for insurance)
strChk691 = "" (ditto)

...... getcher data right here, folks .....

if Err629 = 1 then
strChk629 = " checked "
end if
if Err691 = 1 then
strChk691 = " checked "
end if
Note: the above assumes you store the state of the checkboxes in separate fields. If you store the error number (629 or 691) in a single field and want to check the appropriate box, you can say:

select case ErrorCode
case 629
strChk629 = " ""checked"" "
case 692
strChk691 = " ""checked"" "
end select


Then the code for your checkboxes would look like this:

<input type="checkbox" name="error" value="629" <%=strChk629%>>Error 629</input>

<input type="checkbox" name="error" value="691" <%=strChk691%>>Error 691</input>


That should set the state of the checkboxes.

[This message has been edited by UncaDanno (edited 08-06-2000).]

Dang ol symbols.....

[This message has been edited by UncaDanno (edited 08-06-2000).]
UncaDanno is offline   Reply With Quote