Date time picker setting current date at creation

  • Thread starter Thread starter eyad hasan
  • Start date Start date
E

eyad hasan

I created a helpdesk custom form and used microsoft date and time
picker control that comes with VS 6.0.

My problem is that the date defaults to the form publishing date. I
would like the default date to be the date of today, the request
creation date, would any help me?

I tried the properties dialogue, wrote certain code to set the date,
but unfortunatley I failed to get it.

I use OL2000 on Win2k/sp4

Thanks in advance.
 
I created a helpdesk custom form and used microsoft date and time
picker control that comes with VS 6.0.

My problem is that the date defaults to the form publishing date. I
would like the default date to be the date of today, the request
creation date, would any help me?

I tried the properties dialogue, wrote certain code to set the date,
but unfortunatley I failed to get it.

I use OL2000 on Win2k/sp4

I never had this problem. Setting Me.controlname.Year = Year(Now) or
somesuch always worked. Here's some unedited code which retrieves the
date when the application was run the previous time from the registry
(regApp etc. are global constants); there are two controls: FirstDate
and LastDate.

Private Sub Form_Current()
Static fd As Date, ld As Date

Me.Visible = True
If fd = "00:00:00" Then
fd = GetSetting(regApp, regSec, regKeyF)
With Me.FirstDate
.Year = Year(fd)
.Month = Month(fd)
.Day = Day(fd)
End With
End If

If ld = "00:00:00" Then
ld = GetSetting(regApp, regSec, regKeyT)
With Me.LastDate
.Year = Year(ld)
.Month = Month(ld)
.Day = Day(ld)
End With
End If

End Sub

Good luck.
 
First check the Properties of the DTPicker, and make sure that Value
"Property to use" is "Value" and that Initial value is set to functio
"Date()
 
Back
Top