Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTPicker Not Refreshing

Status
Not open for further replies.

StewartJ

Programmer
Apr 3, 2002
74
GB
I am using a DTPicker control in a VFP6.0 form. I set the control's properties in the form Activate event, eg:

WITH oleDTPicker
.Day = 1
.Month = 2
.Year = 2003
.Refresh
ENDWITH

This works fine and the correct date is displayed.

A user selects a data set from another control in the form. I then want to reset the value displayed in the DTPicker to a date appropriate to that data set so, in the selection control's Click event, I have something like :

WITH THISFORM.oleDTPicker
.Day = m.NewDate
.Month = m.NewMonth
.Year = m.NewYear
.Refresh
ENDWITH

I have confirmed that this is a valid date and querying the individual properties and THISFORM.DTPicker.Object.Value all return the new date but the DTPicker still displays the original date!

How can I get the DTPicker control to refresh? All suggestions welcome!!
 
PROBLEM SOLVED!

The Form.Activate event is triggered for every user interaction with any contained control. Code in the Form.Activate event was messing things up. Solution was to add a test to the Form.Activate event to determine whether this was the first time in.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top