Conditional formatting - from another table

Gismo

Registered User.
Local time
Today, 17:04
Joined
Jun 12, 2017
Messages
1,298
Hi,

i need to highlight a control if a value is met from another table
i used expression:# [DAW Sheet Data File]![Raise CS Order]=2#
but does not highlight.
any reason why?

1590410899785.png
 
Just how is CF meant to be able to look into a table?, for what particular record? :unsure:

Bring the data into the form, then address that control in the CF rule.
 
It is possible with DLookup but I agree - bring the data into the form. If more than one record could satisfy the DLookup function then the value returned by it would be random.
EDIT - BTW, not only might multiple records satisfy the lookup, the criteria probably needs to be based on a form field on the current record. If not, the DLookup return will be constant for every record; i.e. if it is true at all, it will be true for any record on the form.
 
Last edited by a moderator:
didnt think this one through
works fine

another question on conditional formatting

is it possible to have conditional formatting to display a text if a pertain value is met?
 
Depends on what you mean by that. Display a text in some control if a format is applied to some control? If using the conditional format dialogs I'd say no, unless someone can come up with an expression that would work. I can't think of one at the moment. If you wanted to do it all in code, then should be doable if you test a format property and then set the value accordingly, but you seem to be going about things in a very odd way.
 
You only need conditional formatting if the form is in continuous view. This can be done simply by code if single form view.
 
Conditionally display text with expression in textbox ControlSource. Use IIf(), Switch(), or Choose().
 
@Pat, I know that. Can you show me where it was posted here that a DLookup was in a query? I don't think you can, which is why I asked if your comment was general in nature or if it was stated, then I missed it, hence I asked that question.
 

Users who are viewing this thread

Back
Top Bottom