Results 1 to 1 of 1
2001-05-14, 09:07 #1kennyritchGuest
Access -> Word DocProperty Fields show wrong date!
Bit of a weird one this ...
I have a mySQL database which I update using an Access front end form. The date format within mySQL is YYYY-MM-DD. When I view my DB using the form, the date is in the form DD/MM/YY which is fine (I'm in the UK and therefore prefer this layout).
However, the problems start when I pass a date value to the DocProperties in a Word document. I use Helen Feddema's excellent code (<A target="_blank" HREF=http://www.helenfeddema.com/CodeSamples.htm>http://www.helenfeddema.com/CodeSamples.htm</A> - Accesss -> Word No.2 - Writing an Access Contact to a Word Letter) and the line .Item("DateDue").Value = Nz(Me![txtDateDue]) passes the date to the Word DocProperty.
The date in Record 1 appears as 17/04/01 (i.e. the 17th April 2001 which is correct) and when I pass this to Word it appears as 4/17/01 if I apply NO formatting to the DocProperty (i.e. no date switch). However, if I use dd MMMM yy as a switch, the date appears as 17 April 01 - PERFECT! The way I want it! However ...
If I use the same date switch for Record 2 in my DB things go wrong. The date in Record 2 appears as 02/06/01 (i.e. the 2nd June 2001 which is correct). When I pass this to Word using the same date switch as before the date appears as 06 February 01! NOT what I want!
Does anyone know what is going wrong and why the SAME formatting switch produces two DIFFERENT date styles? Any help would be appreciated as this is making me go crazy!