Conditional Formatting based on another table (1 Viewer)

Atthe

Member
Local time
Today, 01:10
Joined
Oct 26, 2021
Messages
57
Hi All,

I have a text box within a report that I would like to apply a bold formatting if it matches a record within another table (tblConditionalFormattingBold), Can anyone advise if this is possible?

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:10
Joined
Oct 29, 2018
Messages
21,477
Have you tried using DLookup()?
 

Atthe

Member
Local time
Today, 01:10
Joined
Oct 26, 2021
Messages
57
Essentially, in your Condition Expression, you would use the DLookup() function to compare the current record to another table. Here's a link explaining how to use DLookup().

DLookup Function (microsoft.com)
I am struggling with the syntax, my main table is tbltools and the field is Tool Type and the table I want to field matches against is tblConditionalFormattingBold and field Bold

Can anyone help?
Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 17:10
Joined
Oct 29, 2018
Messages
21,477
I am struggling with the syntax, my main table is tbltools and the field is Tool Type and the table I want to field matches against is tblConditionalFormattingBold and field Bold

Can anyone help?
Thanks
It might be easier to help you if you could post a sample copy of your db.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:10
Joined
May 7, 2009
Messages
19,245
here is a demo.
 

Attachments

  • conditional_report.accdb
    460 KB · Views: 91

Atthe

Member
Local time
Today, 01:10
Joined
Oct 26, 2021
Messages
57
here is a demo.
Thanks for your time, the problem I have is there are over 80 records in my tblConditionalFormattingBold and they could all be in the report so I need to check against all of these not just one and format bold all the matches. Is this possible?

Thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:10
Joined
May 7, 2009
Messages
19,245
concatenate all your "conditions" into a string. use recordset to do this.
use Instr() function to test if your field in report can be found inside the string.
 

Users who are viewing this thread

Top Bottom