Show image based on another control value

steve1111

Registered User.
Local time
Today, 05:04
Joined
Jul 9, 2013
Messages
170
Hi all,

I have a text box [txtTrafficValue] that is a calculated field of two short times. I want an image to be visible if the value is >= 0.0104 (15 minutes). I have in the after update of the field:

if me.txtTrafficValue >= 0.0104 Then
Me.imgWarning.visible = true
Else
Me.imgWarning.visible = false
End if

but when the field does the calculation and updates the image is not appearing. Am i missing something obvious?

thanks for the help
 
If I'm understanding correctly, the after update event of that textbox doesn't fire when the underlying values change (only when data in the control is manually changed). You'd want the after update event of those controls, or perhaps the timer event. Depends on the overall situation and goal.
 
Thanks Paul for the reply, i am firing the after update on the calculated total like you mentioned above. However if i hit refresh the image appears as it should but i have to keep hitting refresh in the ribbon to prompt the changes. I am not super experienced in code so is there a way to do that either after the calculated field updates or on change?
 
I am suggesting putting the code in the after update event of one or both of the 2 time fields.
 

Users who are viewing this thread

Back
Top Bottom