Hi,
I'm missing the point with adding dates from VBA to tables.
I try to add data from a form icn combination with a table:
The dates are however not properly stored. I'v tried format it differently: with or without #, "dd-mm-yy", "yy-dd-mm", "mm-dd-yy" etc.
adding 8-6-05 (8-jun-05) to 14-6-05 (14-jun-05) is added like:
5-8-06
5-9-06
5-10-06
5-11-06
5-12-06
13-6-05
14-6-05
So, I'm mising something...
Could anybody help me explain?
BTW the datefields form the form are datepickerfields
Maaten
I'm missing the point with adding dates from VBA to tables.
I try to add data from a form icn combination with a table:
Code:
For i = Me.dtDatumVan To Me.dtDatumTot
strSQL = "INSERT INTO tbl_TEMP_meer_minder ( FK_medewerker, datum_van, meerwerk, FK_afwezig_reden, reden ) " & _
"SELECT tbl_TEMP_huidige_gebruiker.key, format(#" & i & "#,'yy-mm-dd') AS datum_van, " & Me.cmbRedenAfwezig.Column(2) & " AS MeerWerk, [Forms]![frmMeerMinderWerk].[cmbRedenAfwezig] AS FK_afwezig_reden, '" & Me.cmbRedenAfwezig.Column(1) & "' AS Reden " & _
"FROM tbl_TEMP_huidige_gebruiker;"
DoCmd.RunSQL strSQL
Next i
The dates are however not properly stored. I'v tried format it differently: with or without #, "dd-mm-yy", "yy-dd-mm", "mm-dd-yy" etc.
adding 8-6-05 (8-jun-05) to 14-6-05 (14-jun-05) is added like:
5-8-06
5-9-06
5-10-06
5-11-06
5-12-06
13-6-05
14-6-05
So, I'm mising something...
Could anybody help me explain?
BTW the datefields form the form are datepickerfields
Maaten