Importing to a word Bookmark

Lochwood

Registered User.
Local time
Today, 03:26
Joined
Jun 7, 2017
Messages
130
I have a query data that imports into a word template using bookmarks.

What would the syntax be to import date field as long date.. currently defaulting to general date on the word doc but long date on the query.

WDoc.Bookmarks("Client").Range.Text = Nz(rs!Client, "")
WDoc.Bookmarks("Location").Range.Text = Nz(rs!Location, "")
WDoc.Bookmarks("StartDate").Range.Text = Nz(rs!Act_Job_Start, "")
WDoc.Bookmarks("StartTime").Range.Text = Nz(rs!Mob_Start_Time, "")
WDoc.Bookmarks("ReportTo").Range.Text = Nz(rs!Mob_Report_To, "")
WDoc.Bookmarks("SiteContact").Range.Text = Nz(rs!Mob_Site_Contact, "")
WDoc.Bookmarks("HrsPerDay").Range.Text = Nz(rs!Mob_Hrs_Per_Day, "")
WDoc.Bookmarks("HrsPerWeek").Range.Text = Nz(rs!Mob_Hrs_Per_Week, "")
WDoc.Bookmarks("ProvEnd").Range.Text = Nz(rs!Prov_Job_End, "")
 
Shot in the dark but try

Format(rs!Prov_Job_End, "Long Date")
 
May be a stab in the dark but it worked a treat.. :)

Well, I guess it untested in your situation more than a shot in the dark. ;)

Glad it worked for you.
 
Yeah, I've done some Word automation, but I'm more comfortable converting it to an Access report, even though it may be more work at the beginning. I assumed it was just a lack of familiarity on my part. I automate Excel much more.
 

Users who are viewing this thread

Back
Top Bottom