Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date formatting

Status
Not open for further replies.

BSando

Technical User
Jun 29, 2003
73
0
0
AU
I have a form where I merge a date from Access to word. I want the dates to be : Thursday 17,July, 2003

which works but if I have a date Tuesday 1, July, 2003

I get Tuesday 7, January, 2003. I have checked the table Iam extracting the date from and it is in the format that I want. So I am assuming that the problem is in the export/code.

Here is my code:

----------------------------------------------

Dim objword As New Word.Application
Dim objdoc As Word.Document

DoCmd.OpenQuery "qrxDelcarriersurveydates"
DoCmd.OpenQuery "qrxAddcarriersurveydates"

objword.Application.Visible = True
Set objdoc = objword.Documents.open("C:\carrier survey dates.dot")
objword.Visible = True

objdoc.MailMerge.OpenDataSource Name:="c:\Implementation database Master.mdb",_ LinkToSource:=True, passworddocument:="",_ writepassworddocument:="",_
writepasswordtemplate:="", Revert:=False,_ Connection:="TABLE carriersurveydates",_ SQLStatement:="Select * FROM_ [carriersurveydates]", openexclusive:=False

objdoc.MailMerge.Execute

------------------------------------------------
Thank you in advance


--------------------
Some people make things happen, some watch while things happen, and some wonder 'What happened?'
 
try sending it over as a string, and not date. It is probably formatted by microsoft when sending it over.

--
N.Hunt
 
Mashieman9,

Thanks that seems to have fixed the problem.

Some people make things happen, some watch while things happen, and some wonder 'What happened?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top