On a form I have an unbound control called dteOrderDate
It's format is set to Long Date
When I run the following code:
DoCmd.RunSQL ("Update tblTmpSupplierOrderAllDetails set PurchaseOrderDate = " & Me.dteInvoiceDate)
the date is stored incorrectly. It is stored as a time! for example, 6/9/12 is stored as 01:20:00 AM!
If I try and format the date like this:
DoCmd.RunSQL ("Update tblTmpSupplierOrderAllDetails set PurchaseOrderDate = " & Format(Me.dteInvoiceDate, "dd/mm/yyyy"))
the date is stored as 12:00:29 AM!
tblTmpSupplierOrderAllDetails!PurchaseOrderDate is a date/time field. No format.
What am I doing wrong?
It's format is set to Long Date
When I run the following code:
DoCmd.RunSQL ("Update tblTmpSupplierOrderAllDetails set PurchaseOrderDate = " & Me.dteInvoiceDate)
the date is stored incorrectly. It is stored as a time! for example, 6/9/12 is stored as 01:20:00 AM!
If I try and format the date like this:
DoCmd.RunSQL ("Update tblTmpSupplierOrderAllDetails set PurchaseOrderDate = " & Format(Me.dteInvoiceDate, "dd/mm/yyyy"))
the date is stored as 12:00:29 AM!
tblTmpSupplierOrderAllDetails!PurchaseOrderDate is a date/time field. No format.
What am I doing wrong?