VBA Allowing user to dictate AND vs OR

Access9001

Registered User.
Local time
Today, 01:41
Joined
Feb 18, 2010
Messages
268
Is there a way to do this? Say I have a ton of variables and want to have some logical expression in a conditional, but I want the user to dictate the logic.

e.g.

a and b or c

but maybe the user wants

a or b or c

or

a and b and c


Basically I'd have three binary switches: bina, binb, binc, where 0="or" (e.g. if bina=0, then a can be true or false), but if bina=1, then a must be true. So say bina=0, binb=0, binc=0. This would mean a or b or c need to be true. But if bina=1, binb=0, binc=1, then that'd mean a and c must be true, but b can be either true or false.

Is there a way to do this without needing to write out every possible logical permutation?
 
Last edited:
Figured it out, nevermind. Basically had my conditional be if (elementa>=bina) and (elementb>=binb) and +... etc
 

Users who are viewing this thread

Back
Top Bottom