Refresh control

N

noodleBrain

Ok this has to be simple. How do I get a control to refresh its value after
another control's value changes.

I have two controls txtStartTime and txtEndTime. OnOpen of the form
txtStartTime value = 12:00 hrs. txtEndTime has a default value of one hour
later than txtStartTime, so shows as 13:00 hrs. When I change the value of
txtStartTime, to say 14:00 hrs I want txtEndTime to change to 15:00hrs.

I have looked at the news group and tried all sorts of combinations of
refresh etc. but cant get it working.

Cheers,

nB
 
S

Stefan Hoffmann

hi,
Ok this has to be simple. How do I get a control to refresh its value after
another control's value changes.
You can use Control.Requery to refresh its data.

I have two controls txtStartTime and txtEndTime. OnOpen of the form
txtStartTime value = 12:00 hrs. txtEndTime has a default value of one hour
later than txtStartTime, so shows as 13:00 hrs. When I change the value of
txtStartTime, to say 14:00 hrs I want txtEndTime to change to 15:00hrs.

Private Sub Text0_AfterUpdate()

' Error handling needed if Text0 is not a valid time.
Text2.Value = DateAdd("h", 1, Text0.Value)

End Sub


mfG
--> stefan <--
 
N

noodleBrain

thanks stefan worked a treat

nB

Stefan Hoffmann said:
hi,

You can use Control.Requery to refresh its data.



Private Sub Text0_AfterUpdate()

' Error handling needed if Text0 is not a valid time.
Text2.Value = DateAdd("h", 1, Text0.Value)

End Sub


mfG
--> stefan <--
 
Top