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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word connecting to dynamic table name

Status
Not open for further replies.

funkytunaa

Technical User
Oct 9, 2005
116
AU
I am having a few issues connecting a word mail merge to a dynamic table name.

I have a VB script that creates a table with the name being "letter" & [ClientID] and the record inside that table referencing the Client in the main database. All good.

Then I want word to open and merge from that dynamic table name...This is what I have.....It's wrong....I grasp the concept....I just don't know how to make it right??

Set wrd = CreateObject("Word.Application")
wrd.Visible = True
Set doc = wrd.Documents.Open("z:\letter.doc")
ActiveDocument.MailMerge.DataSource.TableName = letter" & [Forms]![Menu Letters]![ClientID]

Cheers!!
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top