0

:?: How do I change the input and display of the dtpicker control to "dd/mm/yy" format. Also how do I store it in an MS-Access database in the same format (ie. dd/mm/yy ) . ... need help urgently!

Regards,

Swati

4
Contributors
4
Replies
6
Views
10 Years
Discussion Span
Last Post by Naveed_Cn
0

For dtPicker you can use the dtPicker.Format to set it to whatever you want, including dtpShortDate and dtpCustom. If you use custom then dtPicker.CustomFormat can be set to any format (including "dd/mm/yy") however this will then ignore the users regional settings. Hence short date is probably the best choice for what you want.

As for storing it in Access, always store it as a date and then when you want to display it do the formatting. You should never store dates as strings in the database. Set the date format either in your SELECT statement or at the point where the data is displayed to the user.

Regards

D

0

Here you Go...
1:- Firs Place one DTPicker1 on Form.

2:- Go To DTPicker1 Properties and Set Format = 3-dtpCoustom.

3:- Private Sub Form_Load()
DTPicker1.CoustomFormate = "dd-MM-yy"

End Sub
4:- Private Sub Command1_Click()
Dim db As Database
db.Execute ("INSERT InTo Tabel1(iDate) Values(' " & DTPicker1.Value & " ' ")
End Sub

Hope you clear..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.