Topic: DATE TIME PICKER

Hello DriveSoft

I used Date Time Picker as a filter control in the query in my project. My problem is how to reset the date time picker to the current date as a default.

Once you close the form again it appears the date you set on the query but once you quit the project then load it again the date time picker default back to current date.

I need a code to reset the date timer picker by not quitting the program.. Anybody there can hlp me.

Thanks!

Re: DATE TIME PICKER

Hello.


procedure Form2_OnShow (Sender: string; Action: string);
begin
    Form2.DateTimePicker1.DateTime := now;
end;
Dmitry.

Re: DATE TIME PICKER

Hi Manixs2013,
I'm not sure at what stage your are running your query filter but have a look at the attached and see if it gives you some ideas.
Basically, from whatever point (filtered results on form1 or selected record on form2) you return to form1, the datetimepicker always resets to the current date.
Hope this helps,
Derek.

Post's attachments

Attachment icon manixs dtpicker.zip 337.57 kb, 393 downloads since 2017-07-13 

Re: DATE TIME PICKER

Thanks a lot! GOT IT!