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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Checkbox results to MS Access

Status
Not open for further replies.

meltingpot

Technical User
May 11, 2004
118
GB
Im trying to write a query using 4 checkboxes (true or false).

(vechicles used as examples only - point being 4 different checkboxes)

I have (say)4 vechicle types , bike, car, van, lorry and would like the user to search for these items using some or all of the check boxes. so when they check the box (true)they include it in the result set, not checked then not included .

The very simple query …
Result.asp

SELECT bike, car, van, lorry
FROM vehicle
WHERE
bike = (Request.QueryString("bike")) if checked then = True
ect - this is were im not sure..


Query_vehicle.asp sends these over to the above page via the search area with the 4 checkboxes in ....

Request.QueryString("bike") check box name

Request.QueryString("car")

Request.QueryString("van")

Request.QueryString("lorry")

Using MS Access 2003 and ASP vbscript

Any ideas ? ?



 
The important thing to remember about checkboxes on an HTML form is that the value is only submitted if the box is checked.

If your HTML form has this checkbox:
<input type="checkbox" name="Foo">


The logic processing the form submission can do this:
Dim blnFooChecked
IF Request("Foo") = "" THEN
blnFooChecked = False
ELSE
blnFooChecked = True
END IF


or maybe a shorter way to do the same thing:
Dim blnFooChecked
blnFooChecked = Request("Foo") <> ""
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top