Conditional formatting where values are not the same?

G

Guest

I have two little combo boxes that contain a currency code, like USD or CAD.
I'd like to highlight another field for the user to type in an FX if the code
in the two combos is different.

Making this somewhat more difficult is the fact that the PKEY's on the two
are different. IN one case it's a currency id, 1, 2, 3, etc, while in the
other one it's the actual string. That's because in the second case
(Security below), the Control Source is bound to a field in the main form's
data, while the first one is the pkey of a different table. They represent
the same data, just two different views of it.

So I tried this...

Expression Is [Trade Currency].[Value]<>[Security Currency].[Value]

That didn't work, it thought the two were always different and this
expression was always true. But I can understand that's because the .value is
the bound column, not the text, and it IS always different (1 vs USD).

Then I got all excited and used .[Text] instead, but no joy there either. In
this case it doesn't seem to "see" the value at all, and the expression never
fires. The docs seem to suggest that .text is only available in VB.

Could I write my test in VB then somehow call that test (which would return
a boolean) from the Expression Is? Any other suggestions?
 
D

Douglas J. Steele

Value should give you the value of the bound field, which isn't necessarily
the visible field. It seems odd that you'd have the combo bound to the text
field: aren't you storing the number instead?

You could try using [Security Currency].Column(0) to get the value in the
first column of the combo, or [Security Currency].Column(1) to get the value
in the second column.
 

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

Top