Click here to Skip to main content
13,096,763 members (96,419 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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
Updated 3-Jan-13 18:25pm
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
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

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 |
Web03 | 2.8.170813.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2017
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