D
disneygoof via AccessMonster.com
I have been messing with this for a while and to no prevail...I am usning an
INSERT INTO SQL statement to write date to a table. When I try to write
"todays" date to the table Access, or some unknown force, keeps writing
12/30/1899 to the table. When I run debug and check my variables(RR and RD),
they show the proper date...I am not use to working with a 97 database,
unfortunitly, the company does not own anyother version of Access and
upgrading will have to wait.
When I first wrote the code I did not use any variables, I thought maybe I
made a few mistakes so I broke it down to what you see below...still getting
the same issue...HELP!
I've tried ', ", # ...nothing seems to help
Dim RFI As Integer
Dim ITN As Integer
Dim RR As Date 'or String
Dim RD As Date 'or String
RFI = DMax("[RFINumber]", "tblRFI_Log", "[ProjectNo] =" & cboJobs) + 1
ITN = DMax("[ItemNumber]", "tblRFI_Log", "[ProjectNo] =" & cboJobs) + 1
RR = Date + 14
RD = Date
DoCmd.RunSQL "insert into tblRFI_Log (ProjectNO, RFINumber, ItemNumber,
rfidate,_
ResponseRequired) values (" & Me.cboJobs & "," & RFI & "," & ITN & ",
" & RD &_
"," & RR & ")"
INSERT INTO SQL statement to write date to a table. When I try to write
"todays" date to the table Access, or some unknown force, keeps writing
12/30/1899 to the table. When I run debug and check my variables(RR and RD),
they show the proper date...I am not use to working with a 97 database,
unfortunitly, the company does not own anyother version of Access and
upgrading will have to wait.
When I first wrote the code I did not use any variables, I thought maybe I
made a few mistakes so I broke it down to what you see below...still getting
the same issue...HELP!
I've tried ', ", # ...nothing seems to help
Dim RFI As Integer
Dim ITN As Integer
Dim RR As Date 'or String
Dim RD As Date 'or String
RFI = DMax("[RFINumber]", "tblRFI_Log", "[ProjectNo] =" & cboJobs) + 1
ITN = DMax("[ItemNumber]", "tblRFI_Log", "[ProjectNo] =" & cboJobs) + 1
RR = Date + 14
RD = Date
DoCmd.RunSQL "insert into tblRFI_Log (ProjectNO, RFINumber, ItemNumber,
rfidate,_
ResponseRequired) values (" & Me.cboJobs & "," & RFI & "," & ITN & ",
" & RD &_
"," & RR & ")"