Solved

Color specific rows of a subform

Posted on 2011-09-21
7
492 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
[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
7 Comments
 
LVL 58

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 48

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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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 58
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

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
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, when working with VBA, learn some techniques for writing readable and easily maintained code.

691 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