Date format problem

jimday1982

Registered User.
Local time
Today, 18:21
Joined
May 13, 2004
Messages
81
I have a form with the text boxes you see below and for some reason, when the code below executes, it is not formatting the date like I have specified (4 digits in the date). It's only using 2 digits. Any ideas on why this isn't working?

strSQL = "insert into exported_data ( [first name], [last name], [zip-code], [order number], " & _
"[tracking number], [carrier], [date shipped], [memo], ) " & _
"values ('" & ![first name] & "', '" & ![last name] & "', " & ![zip-code] & ", " & ![order number] & _
", '" & ![tracking number] & "', '" & ![carrier] & "', #" & Format(![date shipped], "mm/dd/yyyy") & "#, '" & _
![memo] & "', '" & ![email] & "' )"
DoCmd.RunSQL strSQL

Actually this code works fine on my computer, but another computer, running the same copy of access is hellbent on not diplaying the year with 4 digits even though I'm specifying it...why in the world would it be doing this?
 
Last edited:
It sounds like it is the computer's short date setting.

What is the "Short date style" in the Regional Settings of the Control Panel of the other computer? Does the style there contain only two yy's?
.
 
Good call - changed it to four and it works - thanks!
 

Users who are viewing this thread

Back
Top Bottom