Link to home
Start Free TrialLog in
Avatar of Mithrinder
Mithrinder

asked on

Color Rows On Form

Hello Experts,

I have a form with 3 List Boxes on it.  One of these list boxes has 3 columns of which I would like to either have the entire line or one of the columns seperately display different colors.

I have read through many posts so I am familiar with the fact that this can not be done with a list box directly.

I was hoping for something without having to resort to either a 3rd party control or building an atom bomb to squash an ant.  I have looked at the control at http://www.lebans.com but I would prefer to stick to standard controls if possible.

My first thought was to hide one column that I do not have any events triggered out of and use a subform to display the information on top of the hidden column and hopefully that way I could use the conditional formatting thing to individually set up the colors of the lines in the one column.

Maybe it is because I have not dealt much with subforms but initially Access 2000 complained you could not have a subform on a form set to continuous so I set the main form to single view and was planning to set the subform to continuous so I could use it but I do not see anywhere I can do that and the conditional formatting is greyed out if I try selecting the subform and choosing it.

The column I want to color is text, and all I want to do is change the background color of each record in that column individually....What a hassle this has been for something that seems so simple on the surface...

Hope you all can come up with a solutions out there.


Avatar of mbizup
mbizup
Flag of Kazakhstan image

>if I try selecting the subform and choosing it....
Try right-clicking on the edge of your subform and selecting "Subform In New Window"

You should be able to set properties such as continuous form view from here.  You can also apply conditional formatting byselecting the specific control that you want to format and go to Format -> Conditional formatting...
Avatar of thenelson
thenelson

Take a look at Simulate Combobox in http://www.thenelson.name/#ReportFormTricks 
SOLUTION
Avatar of RonOsborne
RonOsborne

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mithrinder

ASKER

mbizup - In order to use the conditional formatting I have read that it requires the subform to be set to continous mode.  Sooo my main form is now set to single view, it was previously set to continous.  This allows me to now drop the subform on to the form but there is still no way to set the subform to continous, so the conditional formatting is still greyed out.  I can not get the open the subform in a new window menu buy right clicking anywhere on any edge so I am not sure what is up with that.  Am I missing something here?  I would think a subform is a new form dropped onto an existing form right?  I am selecting subform/subreport from the toolbox and drawing a box on my main form  and dropping it down.  The main form has the three list boxes on it.  

thenelson- Thanks for the info but I do not see how that helps me?

RonOsborne- Well I don't know where to even start with that one...I did mention atom bomb I would say that qualifies here...
Another approach would be to open your subform in design view from the database window (on its own, not with the main form) and setting it's default view property to "Continuous Forms".   Also set up the conditional formatting at this time.  Get these properties set prior to "dropping" it on the main form.
Yep, why use a hammer when you can use an atom bomb
It may be old code, but it works, just plug it in and use it, 1 module and 3 lines of code on any continuious form
It hasn't failed since 1995 in thousands of users sites and thier various configurations of Windows OS and Access (just had to toot my own whistle)
Good luck with which ever way you go
mbizup, thenelson, ronosborne and anyothers.

See the form BuyLimitHighTick in the sampledatabase I put together.  You can retrieve the form and supporting tables/queries at:

http://www.yourfilelink.com/get.php?fid=54920

Optimally I would like to be able to change an entire row in HTList0 but I would settle for just making a record in the symbol column Green if the correct conditions were present.

I would even accept some other standard control along side the symbol which could be color coded with HTList0 as it's source.
ronosborne - I certainly don't have anything against old code...  I am just not sure I understand how to apply it to my case.  Can I somehow use this to repaint the background color of any single line in the form HTList0 which is a sample of my form.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you want a double click function for the row you click on, just add a double click event fire each control.
thenelson - Thanks so much for providing me with that form that was all I needed...spent the entire day redoing my trading screen to make the entire thing a subform.  I think I got it all working....we will see tomorrow!

I have opened a followup question for you at https://www.experts-exchange.com/questions/21785356/Points-for-thenelson.html please respond to that so I can award you another 500 points for answering several questions in one.
Glad to help.

Nelson