Image on continuous form based upon query

  • Thread starter Chris F via AccessMonster.com
  • Start date
C

Chris F via AccessMonster.com

Hello all-

Utilizing Access 2007, I have a query that evaulates amount of time spent on
a task. There are two fields, estimatedTime and SumactualTime. I have an
expression that solves for the efficiency of that task based upon those two
fields.
I created a continuous form that shows the task and the efficiency. I would
like to add an image to each record in the continuous field that displays a
particular image based upon the range of the efficiency. For example, for an
efficiency of 100% and greater, star.wmf would be displayed, for efficiency
of 99% to 80%, greencircle.wmf is displayed, 79% - 70%, yellowcircle.wmf is
displayed and efficiency values less than 69% would display a redcircle.wmf.

Is this possible to do?

Any thoughts would be very helpful.
Thanks,
Chris
 
L

Lord Kelvan

yeah

something like


Private Sub Form_Open(Cancel As Integer)
If txtefficiency.Value = 1 Then
Imagebox.Picture = "c:/star.wmf"
Else
If txtefficiency.Value >= 0.8 And txtefficiency.Value <= 0.99 Then
Imagebox.Picture = "c:/greencircle.wmf"
Else
If txtefficiency.Value >= 0.7 And txtefficiency.Value <= 0.79 Then
Imagebox.Picture = "c:/yellowcircle.wmf"
Else
If txtefficiency.Value <= 0.69 Then
Imagebox.Picture = "c:/redcircle.wmf"
End If
End If
End If
End If
End Sub

just change the word
txtefficiency
to the name of the text box that has the value of the efficiency
and
Imagebox
to the name of the imagebox
and
c:/
to the path of the files of the images

AS A NOTE
i dont know if this will work as i dont know if access supports the
file format wmf though it seems to

hope this helps

Regards
Kelvan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top