I have a continuous subform in a form that shows several reminders - it has roughly 6 columns, and the last column has checkboxes where you can check it off if the reminder is complete. Is it possible to color the box if the last column is checked?
This is a great question! +1! (some people seem to give -1 everywhere)
Conditional formatting is limited to the formatting of text only, so you cant color the check box or its background directly.
Here is a full solution that doesn't even require VBA:
Place a new TextBox over your CheckBox an delete its label
Set it to background so it doesn't cover your CheckBox
Bind that TextBox to the same data field as your CheckBox
Set its font color to white (on white background since you don't want to see the text)
Disable it (since you don't want to enter data here)
Also deactivate it (since you don't even want to place the cursor here)
Now set the Conditional Formatting of this TextBox:
1st Condition: If equals 0 then set background AND font color to white
2nd Condition: If equals -1 then set background AND font color to i.e. red
looks great:
Related
I have created a Directional indicator (Green up arrow and Red down arrow) in my SSRS report, referring to the value of the column next to it. This all works ok:
However, I really want the indicator and the value to be in the same cell, like Excel can:
A Google found the following article , where the last post suggest it is possible using the following syntax:
=Format(Fields!Column1.Value, "Format") + " " + "Indicator"
I assume "Indicator" refers to the name I gave to my Direction indicator, but I can't get it to work..
I have read that by using border formatting I can get my two cells to look like one, but I would ideally like it all to be in one.
Any thoughts appreciated!
Mark
I would do this by placing a Rectangle inside of the cell and place your indicator along with another text box inside the rectangle. The downside to this is (depending on how you align the items in the rectangle) the formatting may cause split cells in excel exports.
Ross's method will work and there are alternatives..
The article you referenced was a text indicator not an image (from what I could tell).
You could do something similar by simply adding a a placeholder in the cell (right-click inside the cell and click "create placeholder"). You can then set the font and colour independently from the rest of the cell.
You could use a common font such as wingdings to get arrows and then the value and color properties would be expressions to show the correct 'character' (arrow) and the correct colour.
I have an unbound form with 300+ controls on it that pulls data from line items on an order (via a reccordset) and does calculations to count different products. It's possible to have multiple products with a width of 1, 2, 3, etc counted on this form, it is then programmed in VBA to set the background color of changed values to vbGreen when setting the textbox values so that the user can easily see what has changed.
My boxes are being filled with values however the green background is only showing when you click in the box
If Double20 <> 0 Then
Me.Double20.Value = Double20
Me.Double20.BackColor = VbGreen
End If
Double20 is the variable holding the count (and yes I did try changing the variable name to check for conflicts)
Any Ideas?
Edit: I also tried referring to it explicitly
Forms![DWO Creator Form]![Double20].BackColor = vbRed
and that changes it to red (but only after clicking in it)
All your textboxes have a transparent background.
You either need to set it to "Normal" in design view, or add
Me.Double20.BackStyle = 1
when setting the .BackColor.
In retrospect, this should have been obvious - controls showing their backcolor only when they have the focus is exactly the behavior of a transparent background...
I have a report with a table in it. And each table cell has borders around it.
The problem I'm experiencing is that if I hide the textbox in any of the cells, the borders also disappear.
I want the textbox to hide but still show the borders.
The textbox in question shows the visibility toggle icons (+/-) so I can't use an iif statement to change the textbox's value to be an empty string when I don't want to see anything in it.
You can place the textbox inside a rectangle.
***So , I was having this same issue:* **
The Problem:
I assume that you placed a border around your text box and decided to place the hide and toggle element to your text box. or your Rows are not stepped down. Two solutions, I think the first solution is what you are looking for:
Solution 1:
I Noticed that SRSS reporting also has this grouping feature by rows. So to hide the text in the textbox without losing borders is to create a step-down feature within the grouping. So basically you can assign hide text box property without disturbing the rows above the textbox. This may be a better solution.
Solution 2:
You must instead place the border attribute to your text box and place the hide and toggle function on the individual groups. So for you, you have to remove the hide + toggle feature on the textbox. Right click the group element in your "rows" or "columns" and assign your drilldown hide + toggle feature on the group elements. In other words: "group properties" not "text box properties"
I hope this re-solve your issue.
I ran into the same issue. I solved it by changing the text color to white (or whatever the background color of the textbox is). I was doing this inside a table, and couldn't find a way to insert a textbox inside of a rectangle as stated in the other answer...
I had similar problem and used similar approach like #Anony Mous, but instead of changing text color to background color I used expression to change text value =IIF(InScope("RowGroup") = "True", Fields!Textboxvalue.Value, "") - and it works as expected.
Problem with background color change is that, if user unintendely select the text and makes it active, it become visible.
Just select the Textbox in question, run F4 (to access to the properties chart at the right side of VS or SQL), select the HideDuplicates dropdown and Select the Data Set that you are using :)
I have created a bar chart that shows values on data labels.
The Data label is placed outside the bar
But in some cases the label appears on the bar where the bar is too long.
In this scenario I would like to conditionally change the font/colour of the data label so that it's more visible.
However I can't see a way to dynamically determine where the label has been placed.
What I can think of is this. You can change the background/font color of all those series labels who's value lies in the range of 95%-100% of the maximum "Value". To be exactly precise as to what should be the threshold to change the bg/font color seems a daunting task, but you could play around with test data.
For writing the expression to change the font color,I would first change the dataset and add a column on the lines of PercOfMax. This column can be calculated easily in the dataset by using basic aggregate functions.
Then you need to go to the Chart Series Label properties-->Color and write the expression on the lines of -
=IIF(Fields!PercOfMax.Value>=95, "YELLOW", "BLACK")
As I said, you might need to do some more research to finalize the value of this threshold(which I am assuming to be 95).
Another solution to this problem is to use fill colour of the label and set its background to a bright colour (e.g. colour), and leave the font colour of the label black. Thus you can always see the label, and there is no difference when it's outside of the bar.
I have a continuous form that contains a drop down box whos control source is the id of a record in a support table. The bound column is this support element id. The row source of the drop down list is a query that gets 2 text fields based on the id in the bound column... the first text field is simply text that is displayed... the 2nd text field is a color. these are actual number color codes for access that the user can enter in by changing the color of a box and saving that particular color
for each of the records in the continuous form, they have one of these levels... Blank, Red Yellow or Green... I want the field that displays the color name to have its background color changed to the color that is in the 3rd column of the drop down...
Any ideas?
You're looking for Conditional Formatting. This article will explain how to use Conditional Formatting to do pretty much whatever you want with the background colors:
http://msdn.microsoft.com/en-us/library/aa139965(office.10).aspx