funkytunaa
Technical User
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
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