Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2005, 08:36 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default Conditional Formatting on Subform

Hi Everyone,

I was probably up too late last night working on this one, because my brain isn't working this morning - I have a subform that I have set as a continuous form and I would like to set the background color for each record on that form based on values which it is pulling. e.g. If combobox=1 color=blue, if combobox=2 color=red. Anyone know how best to accomplich this?

Thanks in advance

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
Reply With Quote
  #2 (permalink)  
Old September 12th, 2005, 11:21 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hiya Mike!,

How many values are possible? I spent the last couple of hours and figured out the way to do it, but you have to conditionally format each field on the subform based on the value.

right click on the field you want to change the color on and pick the condition formatting and you'll see what I mean.

Kevin

dartcoach
Reply With Quote
  #3 (permalink)  
Old September 12th, 2005, 11:55 AM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Mike,
I forgot, you have to use the format in the isexpression code:

combobox.value=1

Kevin

dartcoach
Reply With Quote
  #4 (permalink)  
Old September 12th, 2005, 10:15 PM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Hi Kevin,

Sorry, It has been one crazy day. Thanks your solution helped out. I was having some trouble getting all the controls to change their colors (probably related to the late night) but what I ended up doing was setting a textbox to fill the size of the whole detail section, and set it behind everything else. I then set all the other fields to transparent, and set the data source of the big text box to a field containing the key variable, and set both the text and the background to the same color. It has worked out well - I'll have to send you a copy of it once I get done.

Thanks again,

Mike

Mike
EchoVue.com
Reply With Quote
  #5 (permalink)  
Old March 3rd, 2006, 03:25 AM
Registered User
 
Join Date: Mar 2006
Location: Applecross, WA, Australia.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

G'Day Fellas

I have exactly the same requirements (i think) as Mike. I have a form that will contain a detail section to return quite a few records. What I am trying to achieve is one colour per row based on a value returned in each row.
Background:
    Each record represents a customer request
Depending on the whether the request has been completed, responded to or simply plain forgotten, (and this will be determined by a difference in two dates), I would like to colour the entire row (which contains a number of textboxes) a certain colour. ie If the request has just been received and is within the response time (ie 5 days), then I'd colour this row green. On the other hand, if the request had been received two months ago and someone simply failed to respond to it, i would like to colour this entire row red.
Esentially, the users will be able to open the form and dbl click on a record to open the item.

I'd really like to know what your solution was because I've tried the following:
the detail section contains a number of txtbox controls pulled from the field list. I got rid of the labels associated with them.
I've strung them across the detail section.
On the form_open event, I set the width of the first control to cover all the other controls. In the designer, I "sent to front" all of the other controls in the detail section and sent to back the first control.
Likewise, I also set the properties of the other controls to transparent.
Problem is, I need to write some logic to test "each record" for its value that will determine its background colour. Can I do this in the form_open event or what?...

thanks kindly

Grant Williams
Australia
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Formatting on report in Access bronen Access VBA 3 August 1st, 2008 07:33 AM
conditional formatting jeremy1048 Access 4 July 3rd, 2008 11:20 AM
Conditional formatting vemaju Excel VBA 2 June 6th, 2007 04:41 AM
Conditional Formatting Corey Access 1 November 8th, 2005 12:18 AM
Conditional Formatting... In Access??? lguzman Access VBA 2 September 23rd, 2004 03:52 PM



All times are GMT -4. The time now is 08:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.