Really simple - Date syntax for Date entered in Word

RSIboy

Registered User.
Local time
Today, 23:13
Joined
Jul 1, 2004
Messages
32
Hi

Apologies for asking such a simple question, but the solution has evaded me so far.... :confused:

I have some code that creates a Word document, and fills in names & addresses using the 'bookmarks' method in Word. The line in my Access code is:

wd.Selection.TypeText (Date)

which results in the Date being typed in my Word doc as '05/08/2004'. What is the syntax to enter the date as '5th August 2004' ie d/mmm/yyyy?

Any help much appreciated

Dale
Manchester, UK
 
try: format("d mmmm yyyy",now())
But it dosn't do "th", it would give 5 August 2004
 
I'm afraid this just inserts the characters 'd mmmm yyyy'....

Any other suggestions? What syntax would I use to say

Dim variable As Date
variable = Date()

and then (in English) 'Set variable format to "d, mmm, yyyy"'

Cheers

Dale
Manchester, UK
 
Try this:
DIM sVar as string
sVar = format("d mmmm yyyy",now())
msgbox sVar,,"Testing"

And see what happens. You could try date() instead of now(), but both should work.
 
Hi FoFa - tried this code, but it just printed "d mmmm yyyy" again - however, got me searching the help again, and found the correct syntax:

sVar = Format(Date, "d mmmm yyyy")

Thanks for your help!

Dale
Manchester, UK
 
Huh, sorry about that. Some times I get confused between the languages, one is one way, etc, etc.
Glad you got it.
 

Users who are viewing this thread

Back
Top Bottom