Solved

VBA Conditional Formatting of a Field

Posted on 2006-11-16
2
268 Views
Last Modified: 2011-04-14
Hello -

I have a query that returns all orders.  I run a report off that query that has an AuthString MEMO field.  I only want the AuthString field in the report to be visible and change the font to red when a certain condition is met.  

the valid authstring field looks like this (do not display on report):
"Auth: 00456, Transaction: 12345, 1: This transaction has been approved.; avs: Y; cvv: M"

The invalid data in the authstring field looks like this (display on report and turn RED):
Auth: , Transaction: , 1: There was a problem with this transaction.; avs: n; cvv: n
(notice no auth # or transaction # and the message is completely different)

When the report opens and shows ALL orders, for the invalid data I want to be able to display the whole AuthString field  WHERE LIKE "*There was a problem with this transaction*" and change the color of the text to red.  

ELSE

do not display the AuthString field

Thanks for the help

0
Comment
Question by:dbeller
  • 2
2 Comments
 
LVL 58

Accepted Solution

by:
harfang earned 500 total points
ID: 17961864
Hello dbeller

Select the textbox and choose "conditional formatting" from the menu. Use "Expression" and type:

    [AuthString] Like '*problem*'

Then, format in red and you are done.

(°v°)
0
 
LVL 58

Expert Comment

by:harfang
ID: 17961870
No, wait, you don't want the field at all when there is no problem? Then it's not conditional formatting, but conditional hiding (unless the default font is white on white, of course).
Which is it?
(°v°)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now