Solved

Color specific rows of a subform

Posted on 2011-09-21
7
489 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

696 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