Solved

Access 2007 - datasheet, make selected row change background color

Posted on 2011-02-21
9
4,116 Views
Last Modified: 2012-05-11
I've got a form with a subform on it.  The subform is a continuous datasheet.  The purpose of the datasheet is not to enter data, but simply to display data.

When I user clicks on one of the rows in the datasheet I would like it's background color to change.  Or in other words, the record with focus should have a background color, and records should lose the background color on blur.
0
Comment
Question by:JosephEricDavis
  • 5
  • 3
9 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
?continuous datasheet,  is it continuous form or datasheet
0
 
LVL 7

Author Comment

by:JosephEricDavis
Comment Utility
Well yes, a continuous form.
0
 
LVL 7

Author Comment

by:JosephEricDavis
Comment Utility
I've found this...

http://bytes.com/topic/access/answers/847939-change-background-color-entire-row-s

Which talks about placing a rectangle with conditional formatting behind all the controls in a record.

What I'm not sure how to do though is to somehow trigger the value that the conditional formatting depends on in such a way that the current record selected would have the highlighted rectangle in the background.

I'm trying to use the Form_Current() event.  Is there a way to manipulate the controls of the current row from within this function?
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
Comment Utility
I use this:

http://www.lebans.com/conditionalformatting.htm


Added support for Datasheet view and SubForms.

A2KConditionalFormatting.zip is a sample MDB demonstrating how to programmatically setup Conditional Formatting to simulate:

1) Highlighting of the Current Row for a Form in Continuous or Datasheet View

2) Highlighting of Alternate Rows for a Form in Continuous or Datasheet View
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 7

Author Comment

by:JosephEricDavis
Comment Utility
That page is very unclear.  Maybe you could go through there and help me find the answer I need from it.
0
 
LVL 21
Comment Utility
JosephEricDavis,

Did you get a chance to see the working example in the link I provided?
0
 
LVL 7

Author Comment

by:JosephEricDavis
Comment Utility
Yes, I opened up the database file and looked at it, but I don't understand how it is being done.
0
 
LVL 21
Comment Utility
JosephEricDavis,

Do you like any of the examples? If you will let me know  which form you like in the example I will be glad to show the steps for adding it into your database.

0
 
LVL 7

Author Comment

by:JosephEricDavis
Comment Utility
Ok, I think I got it figured out.  Thanks for the guidance.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

13 Experts available now in Live!

Get 1:1 Help Now