Refresh control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

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

Back
Top