And Or Grouping in Conditional Expression

I'm using an If widget to get if the values of 2 columns as such:


Aggregate.List.Current.Table.ILEC = "SW"
and (Aggregate.List.Current.Table.Area = "TX" or
Aggregate.List.Current.Table.Area = "OK" or
Aggregate.List.Current.Table.Area = "AR" or
Aggregate.List.Current.Table.Area = "KS" or
Aggregate.List.Current.Table.Area = "MO")


However, when the condition is met, it always follows the False branch.

I've tried wrapping the entire thing in an IF function (which I don't think is necessary) and it still doesn't work.

What's a little strange is when I debug for a recordset with "SW" and "MO" it shows as:


(Aggregate.List.Current.Table.Area  - unavailable in the current context - 

Aggregate.List.Current.Table.Area   "MO"

Aggregate.List.Current.Table.ILEC   "SW"


It's Friday afternoon and I'm probably missing something obvious.

Can you post a screenshot of your screen? If you are doing this off a table as it appears, then you want to tie it most likely to the Table.CUrrent....  not the aggregate.


Stacey

My inquiry simplified the names for purposes of the forum, but here is the snapshot:



Solution

Your data has SPACeS after the letters. so ILEC = "SW "    which is not the same as "SW" .  Either change your data, the condition or add a trim

Solution

Of course...it's usually the obvious.  Thanks for saving me from having to look at this on Monday.  Time for some drinks.

BTW - is this normal to see the "- unavailable in the current context -" in the debugging?  I'm guessing this is just iterating through a portion of all the "or" statements in the second block and showing the first and the match?

Yes, if the debugger is trying to read a value that is out of its current scope - then that is expected.