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

And/Xor Operator

Status
Not open for further replies.

ParyGoal

MIS
Jul 22, 2006
70
US

This is really stupid question to ask, but I am stuck.
I am trying to evaluate expression in the form of Xor and operator.
If (CheckBoxControl1 Xor CheckBoxControl2) and (CheckBoxControl3 Xor CheckBoxControl4)and etc... then
Do this
else
do that
End if
My Problem is that I have many CheckBoxControls to check, and now I am unable to write more CheckBoxControl on the same line. I think there is a limit on how many characters you can type on the one line in Access.
Is there another way, I can write my expression?
Thank you in advance
ParyGoal
 
Code:
Some code ..... [COLOR=red] _ [/color]
       continuation of some code....

Be sure to include the space before your underscore.

Hope this helps,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Thank you AlexCuse so much. Have a nice weekend !!!
ParyGoal
 
How are ya ParyGoal . . .

I'm not sure at all your using the XOR logic right. Following is the logic table:

[blue][tt]Data1 data2 XOR
***** ***** *****
0 0 False
0 1 True
1 0 True
1 1 False[/tt][/blue]

Calvin.gif
See Ya! . . . . . .
 
Sorry ParyGoal . . . Hit submit too soon . . .

I'm not sure at all your using the [blue]XOR[/blue] logic right.

Following is the logic table:
[blue][tt]Data1 Data2 XOR
***** ***** *****
False False False
False True True
True False True
True true False[/tt][/blue]
Here if either Data1 or Data2 is True [blue]XOR[/blue] is True.

Now consider the [blue]XOR[/blue] from each part of the expression are processed with a logical [blue]AND[/blue]:
[blue][tt]Data1 Data2 [blue]AND[/blue]
***** ***** *****
False False False
False True False
True False False
True true True[/tt][/blue]
Here [blue]both data have be true to return true[/blue]. This means each [blue]XOR[/blue] of the expression has to return true, meaning each [blue]XOR[/blue] (but not both) have only one data true.

Perhaps if explain what you really want to do instead and the criteria controlling the checkboxes.

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank you TheAceMan1 for your response. I actually got it to work using XOR.
In my program logical, either of the two condition have to return a true. Thus if the total of my conditions is true I execute condition A otherwise condition B.
I worked perfectly. Thank you very much for you input
ParyGoal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top