Reputation: 9
I am putting together a dashboard and trying to show a red downward arrow if the value is below 0 and a green upward arrow if above 0, per employee, I have set this up on continuous subform, however the images stay the same for every record. I have tried putting the control source of the image to a field in my query and reference the value behind that source but it makes no difference. Can anyone please help or suggest a better way of doing this? Thanks
Upvotes: 0
Views: 581
Reputation: 2412
If you only want the arrows as visual reference within your forms, you could use the wingdings 3 font instead of images.
So if you've got your form set to continuous and bound to your data that has say, the EmployeeName field and the EmployeeValue field shown:
You could add a 3rd field to the form to calculate the relevant wingdings arrow letter based on the EmployeeValue field.
In the Control Source property of the calculated field you've added, you'll need to define how your calculated field will get its relevant arrow letters:
In this example I've used the following IIF
statement:
=IIf([EmployeeValue]>0,"p",IIf([EmployeeValue]<0,"q","tu"))
In wingdings 3:
(There are a bunch of other arrow styles in wingdings 3; check this chart for other arrow styles and their corresponding keyboard character if you don't like what I've used in this example).
Going back to our form in form view should show the letters being calculated for each row:
All you then need to do is change your calculated field's font to wingdings 3:
As Andre has mentioned, it's then just a case of applying conditional formatting to your calculated field so that they show in your desired colours:
End result:
Upvotes: 1
Reputation: 27644
In a continuous form, every control in the Details section exists only once, even if it is displayed multiple times (for each record). So there is only one set of properties, and you can't change them only for selected rows.
Your best bet is to use Conditional formatting - give the textbox a green background for >= 0
and red for < 0
.
Upvotes: 0