View Single Post
 
Old 08-02-2015, 05:34 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,234
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

If you're using Excel, you shouldn't need the connection string, as the link I pointed you to shows. Assuming the field works when first created, I can't see why it wouldn't also update when refreshed after the Excel data changes. Also, what is the error message? It's a bit hard to diagnose without the error message. That said, based on the workbook attached to your first post, you should be able to use something like:
Code:
{DATABASE \d "W:\\XXXXX\\XXXXX\\Trial MM data RH.xlsx" \s "SELECT `Building`, `Floor`, `Room/Area` FROM `Sheet1$` WHERE `Extent of damage score` = 0 ORDER BY `Sample`" \l "23" \b "191" \h}
or, if the document and data source are stored in the same folder:
Code:
{DATABASE \d "{FILENAME \p}/../Trial MM data RH.xlsx" \s "SELECT [Building], [Floor], [Room/Area] FROM [Sheet1$] WHERE [Extent of damage score] = 0 ORDER BY [Sample]" \l "23" \b "191" \h}
where {FILENAME \p} is an embedded field, as per the link I gave you.

Note that it doesn't really matter whether you delineate the fields with `` or [].
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote