Set Default Date in Datetimepicker using a query

kbsudhir

Sudhir
Local time
Tomorrow, 00:04
Joined
Dec 27, 2007
Messages
20

Hi All,

I am trying to set default date in the DateTimePicker using VBA in access 2007 on Win 7. But I am getting the below error:

PHP:
Run-time error '2763'
DTPicker returned the error: An error occurred in a call to the Windows Date and Time Picker control

I am able to get the date sucessfully using the query. But not able to pass the same to the DTPicker. I have tried below codes but with same error.

Code:
TxtBox_Date.Value = rst!Event_Date 
DTPicker_EventDate.Value = TxtBox_Date

Code:
DTPicker_EventDate.Value = TxtBox_Date.Text

Code:
DTPicker_EventDate.Value = TxtBox_Date.value

Code:
DTPicker_EventDate.Value = rst!Event_Date

Please guide me on where am I going wrong and what should I do get this fixed.

Thanks for all your time and help.

Regards
Sudhir
 

Its done guys.

The right code is:

Code:
DTPicker_EventDate.Value = rst!Event_Date


I was getting that error because my DTP was set in Visible = No mode as I was changing the mode after setting the default date. Now I changed it to visible before setting its default date.

Regards
Sudhir
 

Users who are viewing this thread

Back
Top Bottom