Solved

Color specific rows of a subform

Posted on 2011-09-21
7
457 Views
Last Modified: 2012-05-12
Hello guys,

In access 2002, I have a formular and a subform associated and I would like to color certain rows of the subform in function of a  special features (and not only a simple criteria, which supposes just choosing conditionnal presentation).

The application: my presentation shows a course list from the same table, I would like to color courses which appear in an another table (called course_selection).

Hoping  I have been clear,
Thanks is advance!
0
Comment
Question by:Noero
7 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 125 total points
ID: 36575131
Check out this method, which uses a control behind other controls (which are transparent) to add color or graphics and you can base on any condition(s) you want.

Jim.
ContinuousFormColors.zip
0
 
LVL 19

Expert Comment

by:Eric Sherman
ID: 36575158
Try this ...

Mark the records in a query with a field say Key1 (-1 = True or 0 = False) for the records in both tables.  Then use Conditional Formatting on your form to highlight records where Key1 = -1.

ET
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 125 total points
ID: 36575226
If I have a complex criteria that I need to evaluate, I will generally create a function and then evaluate the function in the conditional formatting expression, something like:

Expression: fnCondFmt([field1], [field2], [field3]) = 1

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 75
ID: 36575615
You might be interested in this:

AlternateColorDetailSection.zip is a class to allow for alternate bands of color for Forms in Continuous View.
http://www.lebans.com/alternatecolordetailsection.htm

(free)

mx
0
 

Author Comment

by:Noero
ID: 36581418
Thanks for your help guys. I am currently studying all the options. First, the one from JDettman:
I have openned  the file but i don't see the link between the color of the item OleBound04 whose source is colorbitmap while it must be connected to the value Colokey or dsiplay override.
If I identified where the function which set the color and the request update, but i cant see the link beetween the control background and the color specified in tables.
I am sure I miss something basic in Access.

Otherwise, i am trying the simplest solution proposed by Fyed: It looks good if only i had not a syntax error that may be you could fix:
I made a function Determine_Color(id as integer, year as integer) as Boolean
i write this in expression: Determine_Color([courseid],[year]) = 1 (or -1) and i obtained a syntax error.
courseid and year are the field of the subform.

DatabaseMX, i will test your class tomorrow!
0
 

Author Comment

by:Noero
ID: 36586461
The trick of fyed works perfectly and is enough for my application (i forgott to put semi colon instead of colons for separating parameters). Thanks for your help guys!
0
 
LVL 57
ID: 36586485
<<The trick of fyed works perfectly and is enough for my application (i forgott to put semi colon instead of colons for separating parameters). Thanks for your help guys! >>

 Did this question get accepted correctly then?

Jim.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

747 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

12 Experts available now in Live!

Get 1:1 Help Now