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

SQL and check boxes

Status
Not open for further replies.

KentMorand

Technical User
Feb 27, 2002
32
US
This is no doubt an easy one. I'm trying to set a list box's row source to what I'm returning from an SQL statement. The where criteria is a check box. What I'm wondering is what do I put into the SQL statement to see if that field has a check. What I have is this

strSQL = "Select Distinct(TechName) From tblTech where tblTech.PIP1 = '" & yes & "'"

This returns a data mismatch when it comes to this line of code

Set rsRecord = db.OpenRecordset(SQL)

Is yes the value I should be passing into this SQL statement? I've tried numerous variations of quotation marks around the yes value but with no luck. Any help would be greatly appreciated and I thank everyone in advance.
 
Checkboxes return either a True or False so if the checkbox is checked then the value is True otherwise it is False.

so your string would look like this:

strSQL = "Select Distinct(TechName) From tblTech where tblTech.PIP1 = TRUE"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top