IanHallett
IS-IT--Management
Hi,
I have the following code which works pefectly well with the exception of the date format:
DoCmd.RunSQL "INSERT INTO Timesheet (EngineerNo,ContractNumber,Chargeable,ChargeCodeNo,Hours,TimesheetDate,Rate)" _
& " VALUES (" & Me!EngineerNo & ",'" & Me!ContractNumber & "'," & Me!Chargeable & "," & Me!ChargeCodeNo & "," & Me!Hours & ",#" & Format$(Me!Timesheetdate, "dd-mm-yyyy") & "#," & Me!Rate & ")"
If I have a date of 01/04/2008, the value posted into the Timesheet table is 04/01/2008. The date format is ShortDate dd/mm/yyyy in the timesheet table all regional settings on my PC are set to UK etc.
Any help would be much appreciated as I am pulling my hair out and I didn't have much to start with.
I have the following code which works pefectly well with the exception of the date format:
DoCmd.RunSQL "INSERT INTO Timesheet (EngineerNo,ContractNumber,Chargeable,ChargeCodeNo,Hours,TimesheetDate,Rate)" _
& " VALUES (" & Me!EngineerNo & ",'" & Me!ContractNumber & "'," & Me!Chargeable & "," & Me!ChargeCodeNo & "," & Me!Hours & ",#" & Format$(Me!Timesheetdate, "dd-mm-yyyy") & "#," & Me!Rate & ")"
If I have a date of 01/04/2008, the value posted into the Timesheet table is 04/01/2008. The date format is ShortDate dd/mm/yyyy in the timesheet table all regional settings on my PC are set to UK etc.
Any help would be much appreciated as I am pulling my hair out and I didn't have much to start with.