By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,064 Members | 1,176 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,064 IT Pros & Developers. It's quick & easy.

Text Box BackColor different for each row in continuous form

GazMathias
Expert 100+
P: 200
Hi Guys,

Anyone know if this is possible?

I have a need to display multiple colours in a subform, next to a colour reference name. My row source includes the RGB values (intColorRed, intColorBlue, intColorGreen).

I currently have the subform set up with the colour name and an unbound text box which I can easily recolour using

Expand|Select|Wrap|Line Numbers
  1. Me.ColourPreview.BackColor = RGB( (Me.the vars above) )
I can't figure out how to make each one adhere to its RGB settings, changing one changes them all, now matter which event I use.

Any insights are much appreciated.
Apr 17 '09 #1
Share this Question
Share on Google+
6 Replies


JustJim
Expert 100+
P: 407
@GazMathias
Check out Stephen Lebans sample DB here which might be of help.

Also a previous Bytes discussion here.

Jim
Apr 17 '09 #2

FishVal
Expert 2.5K+
P: 2,653
@JustJim
Conditional formatting allows up to 3 different formats only.

@Gaz
No way with subform. Use an other control.

P.S. I see at least three candidates to this role: MSComCtl.ListView, MSComCtl.TreeView, OWC11.Spreadsheet.
Apr 17 '09 #3

GazMathias
Expert 100+
P: 200
@FishVal
Thanks Fish' I'll check those out!

Gaz.
Apr 17 '09 #4

NeoPa
Expert Mod 15k+
P: 31,709
That's a tough one Gaz.

Although bound controls can display different values according to what's in the dataset record, Access only has one instance of the control itself. This means that all versions seen on the form reflect the same attributes until you change something, when all change to reflect that of course.
Apr 17 '09 #5

FishVal
Expert 2.5K+
P: 2,653
Just a thought.
If you use Access 2007, you may see what could be done using bound Image control (in a case when color list is not expected to change) or rich text control.
Apr 17 '09 #6

GazMathias
Expert 100+
P: 200
Thanks for your efforts guys, I have now decided to write the system as a web application. This solves the issue. I should have stated before also that the parent record to that above could have multiple instances of the colourways and I would need to draw them all!

So much simpler to just loop the data into a table, convert the RGB values to hex and write them to a td's style.

Gaz
Apr 17 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.