Reverse a check box value

  • Thread starter Thread starter Eric Blitzer
  • Start date Start date
E

Eric Blitzer

I am doing an update query. I want to update a checkbox
field with the oppisite of the value in another checkbox
field. If it is yes in the first field I want the update
to be no. What would the syntax be?

thanks

Eric
 
Try the following in the Update To row:

Not [TableName].[OtherFieldName]

Are both tables available in the query? Will one value always be the
opposite of the other or is this just a "reset" position that will get
changed as it is used?
 
In the Update row under your 2nd yes/no field in query design, enter:
Not [YesNo1]
where YesNo1 represents the name of the first yes/no field.
 
Thanks Wayne. Would this also work?
[OtherFieldName]* -1 -1

Eric
-----Original Message-----
Try the following in the Update To row:

Not [TableName].[OtherFieldName]

Are both tables available in the query? Will one value always be the
opposite of the other or is this just a "reset" position that will get
changed as it is used?

--
Wayne Morgan
MS Access MVP


I am doing an update query. I want to update a checkbox
field with the oppisite of the value in another checkbox
field. If it is yes in the first field I want the update
to be no. What would the syntax be?


.
 
I am doing an update query. I want to update a checkbox
field with the oppisite of the value in another checkbox
field. If it is yes in the first field I want the update
to be no. What would the syntax be?

Update the field MyCheckbox to

Not [MyCheckbox]

The NOT operator returns True if its argument is False, and False if
its argument is True.

John W. Vinson[MVP]
 
I believe it would. True is stored as -1 and False as 0, so your equation
would return:

True
[-1] * (-1) -1 = 0 or False

False
[0] * (-1) -1 = -1 or True
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top