brandondaly
IS-IT--Management
I'm trying to produce a catalog table in Word, which is being populated from an access database.
I've been using the code below to bring back the data for
SubName S15.
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [query_tx] WHERE (([SubName]= 's15' ))" & ""
However I have been having trouble change the code to accept a varible (subnm) in place of the 's15' I've tried the code below to no avail.
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [query_tx] WHERE (([SubName]= "'" & subnm "'" ))" & ""
Can anybody help me correct the code?
Many Thanks
Brandon.
I've been using the code below to bring back the data for
SubName S15.
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [query_tx] WHERE (([SubName]= 's15' ))" & ""
However I have been having trouble change the code to accept a varible (subnm) in place of the 's15' I've tried the code below to no avail.
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [query_tx] WHERE (([SubName]= "'" & subnm "'" ))" & ""
Can anybody help me correct the code?
Many Thanks
Brandon.