converting date from form to field in access
Hi
I have used three combo box in VB 6 form one for selecting date one for month and one for year. If the selection is say 12/07/2007 then I need it to be converted as 12/07/2007 under one field i.e date field of access database. So how can I do this.
For ref. combo1 is for date,combo2 is for month and combo3 is for year
and date is the field in database
table name is mm
database name is nn
Will any one help me by writing the necessary code.
(K.S.)
kehar
Junior Poster in Training
72 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
instead of using 3 combo boxes use DTPicker control and then find out the .Date .Month .year property of the control.
debasisdas
Posting Genius
6,870 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
I used the following code as a trial but it did not work.
Private Sub Command1_Click()
Dim a, b, c As String
Dim d As Date
d = CDate(text1.Text)
a = Combo1.Text
b = Combo2.Text
c = Combo3.Text
d=('" & a & "','dd-mm-yyyy') & to_date('" & b & "','dd-mm-yyyy') & ('" & c & "','dd-mm-yyyy')
End Sub
kehar
Junior Poster in Training
72 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0
Hi
my intention is to make date month year selection as that of IRCTC (railway ticket booking site) There you have to select date month year in different combo box.
Hence any idea
kehar
Junior Poster in Training
72 posts since Sep 2007
Reputation Points: 10
Solved Threads: 0