G
Guest
I'm trying to put a date, in the form of dd/mm/yy into a date field in a
table using an array and the DoCmd.RunSQL command. However, when the query
runs, the form of the date written is something like "00.00.50". I tried
converting the Date Format to ShortDate in the Table Design View, but this
justs ends up making each date 30/12/1899. The code is something like this:
Public DateToWrite(1 to 4) as date
....
then, in the Public SUB...
Dim strQuery As String
strQuery = "UPDATE [Loan Laptops] "
strQuery = strQuery + "SET DateOut = " & DateToWrite(1)
strQuery = strQuery + " WHERE Loan_id = 87;"
DoCmd.RunSQL (strQuery)
table using an array and the DoCmd.RunSQL command. However, when the query
runs, the form of the date written is something like "00.00.50". I tried
converting the Date Format to ShortDate in the Table Design View, but this
justs ends up making each date 30/12/1899. The code is something like this:
Public DateToWrite(1 to 4) as date
....
then, in the Public SUB...
Dim strQuery As String
strQuery = "UPDATE [Loan Laptops] "
strQuery = strQuery + "SET DateOut = " & DateToWrite(1)
strQuery = strQuery + " WHERE Loan_id = 87;"
DoCmd.RunSQL (strQuery)