locked
Incorrect format RRS feed

  • Question

  • User1354396744 posted

    An nice easy one for somebody I'm sure as it's probably something obvious but I'm getting incorrect format errors when trying to do the following...

    IF variable1 = x OR y AND variable2 = x OR y AND variable3 = x OR y THEN 

    ...

    Basically all 3 variables need to be either one of the specified values.

     

    Thanks.

    Thursday, October 21, 2010 6:58 PM

Answers

  • User-1360095595 posted

    Try like this: IF (variable1 = x OR variable1 = y) AND (variable2 = x OR variable2 = y) AND (variable3 = x OR variable3 = y) THEN... You might have to use "x" and "y" if your variables contain string values. By the way, not a VB person so I hope I'm not completely off.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 21, 2010 7:37 PM
  • User-231977777 posted

    IF variable1 = x OR y AND variable2 = x OR y AND variable3 = x OR y THEN  

    Thanks.

     

    hi

    not that way , change it to

    i am c# ,but i know that you must do this :

    if(variable1 = x or variable1 = y ) .

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 21, 2010 7:39 PM

All replies

  • User-1360095595 posted

    Try like this: IF (variable1 = x OR variable1 = y) AND (variable2 = x OR variable2 = y) AND (variable3 = x OR variable3 = y) THEN... You might have to use "x" and "y" if your variables contain string values. By the way, not a VB person so I hope I'm not completely off.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 21, 2010 7:37 PM
  • User-231977777 posted

    IF variable1 = x OR y AND variable2 = x OR y AND variable3 = x OR y THEN  

    Thanks.

     

    hi

    not that way , change it to

    i am c# ,but i know that you must do this :

    if(variable1 = x or variable1 = y ) .

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 21, 2010 7:39 PM
  • User1354396744 posted

    Thanks for that. I knew it would be something obvious! 

    Friday, October 22, 2010 8:17 AM