Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
When I change the querystring to use a different table, thefieldnames don't update
I'm using an OLEDB connection to an excel workbook. The workbook has
two spreadsheets with data. When I use the datasource.querystring property to change the name of the spreadsheet (table) I'm using, the fieldnames remain what they were for the first table. How can I get the fieldnames to update to those of the second table? I don't have any idea how the process of gathering the field names works. I put the field names I want in the first row of the table and it always picks up on the for table I specify in the opendatasource sql statement. I suddenly have an idea for a workaround. What if I use a sql statement in the opendatasource statement like: "SELECT * table1, table2", and then change the query string to "SELECT * table1 WHERE ..." and after I gathered all the info from table1, change the querystring to "SELECT * table2 WHERE ..."? Could work. Only problem is, I was using both SQLStatement, and SQLStatement1 in the opendatasource statement because my queries can be long and the querystring property can only be used up to something like 255 characters. Any ideas about that? Thanks. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Update Table of Contents: Document Not Seeing heading update | Microsoft Word Help | |||
doc.Mailmerge.datasource.querystring=strSQL; Command Failed: Run-Time error 4198 | Mailmerge | |||
Mailmerge, querystring and (un)logical SQL (Word 2003) | Mailmerge | |||
Mailmerge Querystring Problems | Mailmerge | |||
Word Mail Merge with QueryString longer than 255 characters | Mailmerge |