Color coding based on time elapsed

B

Bill

I have a database that tracks calls for service. I want to have a main
screen which will show all open calls for service and auto refresh. The
trick is that as it refreshes I want to see a color change for the line item.
Example if the call is new, it can show green. After 7 minutes it turns to
yellow and after 10 minutes it turns to red. How can I use an event timer to
tiger these changes?

Thank you,
 
D

Dirk Goldgar

Bill said:
I have a database that tracks calls for service. I want to have a main
screen which will show all open calls for service and auto refresh. The
trick is that as it refreshes I want to see a color change for the line
item.
Example if the call is new, it can show green. After 7 minutes it turns
to
yellow and after 10 minutes it turns to red. How can I use an event timer
to
tiger these changes?

If this is a continuous form, you would probably need to use conditional
formatting, rather than attempting to change property values in a timer
event. You'd need to have a field in the record that stores the date/time
the call was opened. I haven't tried this, but given such a field, I think
you could use format expressions such as

DateDiff("n", [TimeOpened], Now()) >= 7

DateDiff("n", [TimeOpened], Now()) >= 10
 
B

Bill

Sorry it's been so long that I have not replied. Thank you for help me with
this. I see how you are comparing the time elements, however how would I
change the field property of the color based on the expiration of time? I'm
thinking:::

If DateDiff("n", [TimeOpened], Now()) >= 7 Then
Me.GeneralField.Back Color.65535
Else
Me.GeneralField.Back Color.16777215
End If

Then if this works, I need to refresh the screen every 30 seconds and update
the colors as appropriate.

Thanks for the help

Bill



Dirk Goldgar said:
Bill said:
I have a database that tracks calls for service. I want to have a main
screen which will show all open calls for service and auto refresh. The
trick is that as it refreshes I want to see a color change for the line
item.
Example if the call is new, it can show green. After 7 minutes it turns
to
yellow and after 10 minutes it turns to red. How can I use an event timer
to
tiger these changes?

If this is a continuous form, you would probably need to use conditional
formatting, rather than attempting to change property values in a timer
event. You'd need to have a field in the record that stores the date/time
the call was opened. I haven't tried this, but given such a field, I think
you could use format expressions such as

DateDiff("n", [TimeOpened], Now()) >= 7

DateDiff("n", [TimeOpened], Now()) >= 10


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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