Hello,
I am trying to pass a date into a Access Table through VBA
and all of the information goes in right except for the date, it always comes up as 12/30/1899 in the table. I did a message box to display the format that it is leaving the form in and it is correct 6/7/2007 here is the code:
Dim sq5, options, values, proID, dt, hrs As String
options = "([ProjectID], [dt1], [hrs1])"
values = "(" & proID & "," & dt & "," & hrs & ");"
If txtDateRcvd = txtDueDate Then
Set db2 = CurrentDb
sq5 = "INSERT INTO tbl" & whichCompany & "BreakDown" & options & "VALUES" & values
MsgBox sq5
DoCmd.SetWarnings False
DoCmd.RunSQL (sq5)
DoCmd.SetWarnings True
pid = -1
Call txtstaff_Change
Set db2 = Nothing
I am pretty sure this is a simple problem, but I am going nuts trying to figure it out any help would be greatly appericated. Thanks.
I am trying to pass a date into a Access Table through VBA
and all of the information goes in right except for the date, it always comes up as 12/30/1899 in the table. I did a message box to display the format that it is leaving the form in and it is correct 6/7/2007 here is the code:
Dim sq5, options, values, proID, dt, hrs As String
options = "([ProjectID], [dt1], [hrs1])"
values = "(" & proID & "," & dt & "," & hrs & ");"
If txtDateRcvd = txtDueDate Then
Set db2 = CurrentDb
sq5 = "INSERT INTO tbl" & whichCompany & "BreakDown" & options & "VALUES" & values
MsgBox sq5
DoCmd.SetWarnings False
DoCmd.RunSQL (sq5)
DoCmd.SetWarnings True
pid = -1
Call txtstaff_Change
Set db2 = Nothing
I am pretty sure this is a simple problem, but I am going nuts trying to figure it out any help would be greatly appericated. Thanks.