Conditional Formatting

rclarke

Registered User.
Local time
Today, 12:42
Joined
Jul 13, 2012
Messages
24
Conditional formatting expression from a subform or table value

Hi,

I have two related tables and a form and subform. The main form [frmTrialInfo] contains data from [TblTrialInfo] and a subform [subfrmChecklist] with data from [TblChecklist]

I want to use conditional formatting to bold a box in the [frmTrialInfo] is a control in subfrmChecklist or TblChecklist is checked No

I have tried the following expressions, however none have worked, can you spot my mistake? Is it possible to format a field in a form from a subform or a table value, as neither approach has worked.

I have used the following conditional formatting on the field I wish to bold, however none of these have worked?

[subfrmChecklist.PharmReq]=No

[TblChecklist.PharmReq]=No

Any ideas if this is possible, or what I might be doing wrong? No luck with the formatting of the form no matter what I have tried!
 
Last edited:
In your conditional formatting you need to choose Expression Is then hit the Ellipsis button to open the expression builder

attachment.php


From there you can visually build the required expression to apply the formatting

attachment.php


at any rate your expression should look something like;
Code:
[subfrmChecklist.PharmReq].Form![TblChecklist.PharmReq] = 0
Remember a check box will return "No", False or 0 when unchecked or "Yes", True of -1 when checked.

Note: Yes and No must be enclosed in quotation marks whilst True/-1 and False/0 do not require this treatment.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    34.8 KB · Views: 236
  • Capture2.PNG
    Capture2.PNG
    60.7 KB · Views: 194
Thank you for such a detailed response, worked perfectly. Access 2003 doesn't have the elipsis icon, however I was able to use the expression builder from the toolbar prior to editing the form.

Much appreciated!
 

Users who are viewing this thread

Back
Top Bottom