Click here to Skip to main content
12,507,343 members (70,759 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB6 Oracle
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 3-Jan-13 18:14pm
surkhi623
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I am using following code in my project


May be following code will help

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

and its working like charm
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160927.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100