Power Tip: Supercharge conditional formatting by using a bit of code

Over the past few versions of Access, the product team has steadily added more conditional formatting functionality for forms and reports. For example, in Access 2010, you can add up to 50 conditional formatting rules for each object without having to write any Visual Basic for Applications (VBA) code. However, if you're working in an earlier version, or if you just prefer to use VBA to perform formatting tasks on your forms and reports, Juan Soto of AccessExperts.net has blogged about some VBA-based conditional formatting techniques that he has implemented recently. He provides a code sample that you can copy and try out for yourself, so take a look!

Thanks Juan!

--Chris Downs 

Got a Power Tip you'd like to share? Send it to us at accpower@microsoft.com.

 

Office Blogs Comments

Comments: (3) Collapse

  • Of course Conditional Formatting is a great feature.  However, When used on a Continuous or Datasheet Form with many rows ... and say 3 format conditions, the condition results (eg colors) can be a little slow in rendering when displaying, say after a requery or when opening the form.  I'm wondering if this has been improved in A2010 along with allowing more than 3 conditions (which is nice) ? In other words, I wonder how this plays out with say 10, 20 or 30 or more conditions?

    mx

  • Conditional formatting is great, but I've run into a bug with conditional formatting in print preview in reports in Access 2007.  When I have entries bolded based on a certain date (entered in a separate form), the last few words of random bolded entries are cut off.  It has nothing to do with field type or length and doesn't seem to happen to unbolded text boxes.  Is this an issue Microsoft is aware of?  Any ideas on how to get around it (while keeping the bolding)?

    Lindsay

  • Thanks for the comments, Joe and Lindsay. I've passed them on to the product team. To get more insight into these kinds of issues, I recommend searching or posting to the Access forum on Microsoft Answers (answers.microsoft.com/.../access).

    Thanks for visiting the Access Blog!

    --Chris

Comments

Comments: (loading) Collapse