Morning All,
I'm having a nightmare with dates in Access VBA! Here is what's happening:
The date is entered on a form using the date picker. Let's say I select 07 April 2013. This is then then transfered to a date variable (dtNewDate). The value in the variable is then inserted into a date field in a table (DoCmd.RunSQL "UPDATE tbl_AccountBase SET NextCallDate = #" & dtNewDate & "# WHERE AccountRef = '" & CurrentAccount & "'")
The field from the table is then displayed in long date format on another form, but it's showing as 4th July 2013, not 7th April as I originally selected!
Access seems to be switching the format all by itself without any help! Can anyone tell me where this switch occurs? And what's the best way to handle it?
Thanks in advance for any help,
Simon
I'm having a nightmare with dates in Access VBA! Here is what's happening:
The date is entered on a form using the date picker. Let's say I select 07 April 2013. This is then then transfered to a date variable (dtNewDate). The value in the variable is then inserted into a date field in a table (DoCmd.RunSQL "UPDATE tbl_AccountBase SET NextCallDate = #" & dtNewDate & "# WHERE AccountRef = '" & CurrentAccount & "'")
The field from the table is then displayed in long date format on another form, but it's showing as 4th July 2013, not 7th April as I originally selected!
Access seems to be switching the format all by itself without any help! Can anyone tell me where this switch occurs? And what's the best way to handle it?
Thanks in advance for any help,
Simon