Date time picker setting current date at creation

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

Michael Bednarek

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

rdschulte

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

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

Top