connie.kamrowski at agric.nsw.gov.au
connie.kamrowski at agric.nsw.gov.au
Wed Oct 15 17:42:33 CDT 2003
OK I tried Dim as String it still displays the date in the sub form as a complete reverse. ie: 17/10/02 is entered... passed as 10/17/02 to strSQL (verified by msgbox) the value saved to the subform is 02/10/17 The field is formatted to ShortDate both in the Table and also on the form, but returns it in complete reverse. Connie Kamrowski Analyst/Programmer Information Technology NSW Agriculture Orange Let's take "1 Feb 03" > Dim Finished As Date You have dimmed it as a Date, .... > Finished = Format(Forms![worksheet]![FinalDate], "mm\/dd\/yyyy") > Format() creates a Variant containing a string "02/01/03" You now poke that into the date variable "Finished". When you do so, the system converts the string into a date and uses your regional settings so interprets it as "2 Jan 03" You would have been OK if you had dimmed Finished as String :-) > ' Create SQL string. > strSQL = "UPDATE worksheet SET finished = #" & Finished & "# WHERE > tsid = " & TSID > ' Run action query. > mydb.Execute strSQL > -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support. This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient or received it in error, please delete the message and notify sender. Views expressed are those of the individual sender and are not necessarily the views of their organisation. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20031016/fee8f395/attachment-0001.html>