Juls
Juls

Reputation: 9

Access 2013 - Continuous Forms and images

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

Answers (2)

Matt Hall
Matt Hall

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:

enter image description here

You could add a 3rd field to the form to calculate the relevant wingdings arrow letter based on the EmployeeValue field.

enter image description here

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:

enter image description here

In this example I've used the following IIF statement:

=IIf([EmployeeValue]>0,"p",IIf([EmployeeValue]<0,"q","tu"))

In wingdings 3:

  • The letter "p" will show as an up arrow
  • The letter "q" will show as a down arrow
  • The letters "tu" will show a left and right arrow next to each other

(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:

enter image description here

All you then need to do is change your calculated field's font to wingdings 3:

enter image description here

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:

enter image description here

End result:

enter image description here

Upvotes: 1

Andre
Andre

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

Related Questions