Click here to Skip to main content
15,878,852 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
VB
Private sub cmbrollno_click()
x = Format(DTPicker1.Value, "dd-mmm-yyyy")
        DTPicker1.Value = RES!DATE_OF_BIRTH
End sub

I wrote this code in combo - rollno click event.I do not loaded date_of_birth onto form_load event.I am using this code at various controls like: command1 - Inserting, command2 - Updating and combo rollno - displaying info of selected roll no.
I wanted to ask that is this code syntactically correct to be used in vb6? or code should be placed in other event or anything else?

While inserting and updating records it is giving error like: Invalid Use of Property.
Please help me.....
Posted
Updated 3-Jan-13 18:25pm
v2
Comments
Maciej Los 13-Feb-13 13:28pm    
I guess you are getting data from Oracle database into ADODB.Recordset. Probably, you do that on Form_Load() procedure. Am i right?
So.. You need to set value to DateTimePicker only in this event (Form_Load). Provide the biggest part of code, especially where data are loaded.

1 solution

I am using following code in my project


May be following code will help

VB
DTPicker1.Value = Date
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy"


and its working like charm
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900