Solved

VBA Conditional Formatting of a Field

Posted on 2006-11-16
2
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

735 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