UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Conditional Formatting on Continuous Form With Six Conditions    
 
   
mnussbaum
post Nov 26 2007, 09:30 AM
Post#1



Posts: 123
Joined: 23-March 07



I have a continuous form. One text box is called "Status" and has six possible choices. I'd like to color the background of the Status text box based on the status. For example, if status is "On Hold" the background of the Status text box should be red. How do I get beyond the limit of 3 conditions?
Go to the top of the page
 
TheOtherDodge
post Nov 26 2007, 09:54 AM
Post#2



Posts: 1,666
Joined: 3-May 01



You can go into VBA and set the back ground color there, based on the selection.
x:
Private Sub status_AfterUpdate()
if me.status = "On Hold" then
me.txtStatus.backcolor = vbRed
.....etc...
Go to the top of the page
 
niesz
post Nov 26 2007, 09:58 AM
Post#3


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


The simple answer is "You can't." Conditional formatting is limited to 4 ... The default and the 3 conditions.
You will need to use something like this.
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 10:50 AM
Post#4



Posts: 123
Joined: 23-March 07



So I saw the referenced thread, interesting technique. However, I'm having trouble with the z-order. When I place the colored text boxes on the Status text box, it covers it up. If I place Status on the colored boxes the color is there but again the Status is hidden. How do I put the Status box on top?
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 10:59 AM
Post#5



Posts: 123
Joined: 23-March 07



Related question: can I set the Back Color property for the Status text box using a function? In other words, instead of a number in the Back Color box (e.g., -2147483643), have it point to a function that calculates the color based on the value of the text box?
Go to the top of the page
 
niesz
post Nov 26 2007, 11:02 AM
Post#6


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


You cannot control this via code because of it being a continuous form. When you change the backcolor, it will change it for all the records.
It would be best if you just posted a stripped copy of the DB with a detailed explanation of the coloring you need and I'll take a look.
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 11:14 AM
Post#7



Posts: 123
Joined: 23-March 07



Attached is a much simplified version. Basically, for each status I'd like a unique color to be displayed on the form. Thanks in advance!
Attached File(s)
Attached File  Status.zip ( 12.55K )Number of downloads: 55
 
Go to the top of the page
 
niesz
post Nov 26 2007, 11:17 AM
Post#8


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


Do you mind reposting it in ACC2000 format? Either that or I"ll have to wait till I get home to open it with 2003. Thanks!
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 11:19 AM
Post#9



Posts: 123
Joined: 23-March 07



Attached...
Attached File(s)
Attached File  Status2000.zip ( 11.9K )Number of downloads: 27
 
Go to the top of the page
 
niesz
post Nov 26 2007, 11:27 AM
Post#10


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


See attached...
Attached File(s)
Attached File  Status2000.zip ( 12.98K )Number of downloads: 129
 
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 11:40 AM
Post#11



Posts: 123
Joined: 23-March 07



What do the █'s represent in the text box? And did you do anything special to get the Status to remain on top?
IIf([Status]=4,"████████████████████████████","")
Go to the top of the page
 
niesz
post Nov 26 2007, 11:42 AM
Post#12


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


Those are Full Block characters in the Terminal font.

To get Status on top of them all I selected the Status field, placed it on top of all the other boxes, and chose "Format> Bring to Front" off of the menus.
Go to the top of the page
 
mnussbaum
post Nov 26 2007, 01:49 PM
Post#13



Posts: 123
Joined: 23-March 07



img src="http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif" style="vertical-align:middle" emoid=":thumbup:" border="0" alt="thumbup.gif" /> Works like a champ! For some reason I was looking in the properties box and right-click menus for that. Thanks for all your help!
Go to the top of the page
 
Bradley110
post Mar 26 2008, 12:19 PM
Post#14



Posts: 21
Joined: 15-February 08



I have been using this code for a while now. Not to bring this out of the grave, but is there any way that you could subsitute the █ for something else. What I really wish to accomplish is to allow a printer friendly version of the code. When I look in the print preview it looks beautiful, but as I print you can still see all of the █'s.
Thanks in advance.
Go to the top of the page
 
niesz
post Mar 26 2008, 12:23 PM
Post#15


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


Printer drivers can wreak havoc on higher Character Set values.
The only thing I could recommend is trying a different font and finding another Full Block character. You would then just change the font formatting of the control to match.
You can use the system Character Map to explore new fonts.
Start> All Programs> Accessories> System Tools> Character Map
...and hope your printer driver does not thrash the new one.
Go to the top of the page
 
Bradley110
post Mar 26 2008, 12:42 PM
Post#16



Posts: 21
Joined: 15-February 08



Awesome. Worked like a charm. I just found a full block character that actually looks like a block.
Thanks for the very prompt reply.
-Brad
Go to the top of the page
 
niesz
post Mar 26 2008, 01:23 PM
Post#17


Utter A-fishin'-ado
Posts: 17,958
Joined: 1-August 05
From: Cincinnati, Ohio, USA . . . ><((((░>


NP. thumbup.gif
You may consider sharing the font you used so that others who are having the same issue can benefit. wink.gif
Go to the top of the page
 
playtowin
post Sep 11 2008, 11:58 AM
Post#18



Posts: 183
Joined: 30-December 04
From: Georgia


I had the same issue as Bradley110, when it came to printing reports that use this technique. I went to the Character Map (Start> All Programs> Accessories> System Tools> Character Map), checked the Advanced View box, and then searched for Full Block.
On my machine, the only resulting character is called U+2588 Full Block and it looks like a solid, upright, black rectangle.
Ocopied this from the Character Map and pasted it in place of the █ and the print output looks like the screen output. WYSIWYG.
Thanks Walter, for such a slick workaround to the conditional formatting limitation!
Mark
Go to the top of the page
 
tkepongo
post Sep 20 2011, 12:51 PM
Post#19



Posts: 1
Joined: 30-June 11



I know this is a pretty old thread, but I was wondering if anyone knew how to change the conditions. For example, the attached files have conditions such as
div class='codetop'>CODE
=IIf([Status]=4,"████████████████████████████","")

How do I change it so that it searches for a string such as
CODE
InStr([Status],"Complete")<>0

Thanks!
Go to the top of the page
 
Bubba327
post Oct 28 2014, 07:44 AM
Post#20



Posts: 1
Joined: 27-October 14



Agreed, this works great, especially for those of us stuck in the stone ages of Microsoft Access. Thanks a bunch!!!!
Why oh why did they not only limit conditional formatting to 3 conditions and then not give you the option to "detail_format" a form like you can for a report.
UUUUgggghhhhh!!!!!!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    12th December 2017 - 08:18 PM