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

Update query trouble selecting both

Status
Not open for further replies.

kdoran

Technical User
Joined
Mar 23, 2003
Messages
88
Location
US
I have two check boxes on the same table and I want to run an update query that will look for both checks per line and then remove them. If they are both not present either one will stay checked.

Any ideas?

Thanks,

Kelly

 
Your criteria should be

Where CheckBox1=True AND Checkbox2=True

If you do this in the query design window, drag the two checkbox fields to the bottom panel. Set the criteria for both to be True on the same criteria row.

In the "Update To" cell, enter the keyword False.

View the query in Datasheet mode to see what you'll be updating and then run it.
 
first run this select query to make sure you are only getting the results you want to change:

Code:
SELECT * FROM TABLENAME WHERE WHERE CHECKBOX1 = -1 AND CHECKBOX2 = -1

if you see all the results you are expecting then you can run the update query:

Code:
UPDATE TABLENAME SET CHECKBOX1 = 0, CHECKBOX2 = 0 WHERE CHECKBOX1 = -1 AND CHECKBOX2 = -1

Leslie
 
Thanks, I will give that a try.

Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top