Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / July 2004

Tip: Looking for answers? Try searching our database.

Database field code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BillBarclift - 09 Jul 2004 20:46 GMT
The following works fine:

{ DATABASE  \d "C:\\Documents and Settings\\billb\\Desktop\\Junk.xls"
\c "RevInfo" \s "SELECT PageNumber, RevDate FROM C:\\Documents and
Settings\\billb\\Desktop\\Junk.xls WHERE PageNumber=3" }

The following does not work when I try to replace pagenumber with the
field code for page number:

{ DATABASE  \d "C:\\Documents and Settings\\billb\\Desktop\\Junk.xls"
\c "RevInfo" \s "SELECT PageNumber, RevDate FROM C:\\Documents and
Settings\\billb\\Desktop\\Junk.xls WHERE PageNumber = { PAGE \*
MERGEFORMAT }" }

I've tried several variations of this with no success...any ideas?

Also, can someone can tell me how to replace the hardcoded path
(filename will be known, but directory will always be same as the word
file)?

Thanks in advance,

Bill
Peter Jamieson - 11 Jul 2004 10:10 GMT
A similar Database field works OK here, except I removed \*MERGEFORMAT which
you do not need.

Questions - neither of the following two things seems likely but they are
the only things I can think of right now:
a. Are the {} around the PAGE field the ordinary {} you can type on the
keyboard? If so, they will not work - use ctrl-F9 to insert a pair of the
special field code braces and type PAGE in between them.
b. What is the result of the { PAGE } field (e.g. if you execute such a
field outside the { DATABASE } field? If the result is something like 2-5 or
iii then the comparison will not work as you expect - in that case, you
might need to change the format of your page numbers or use a different
formatting switch such as \*Arabic to return a number. If you are expecting
the result to be (say) 1, ensure { PAGE } actually returns 1 and not 0. If
there is no record where PageNumber = 0 the DATABASE field will fail.

It looks to me as if you are probably using Word 2000 or earlier and/or
connecting using DDE, but if none of the above helps, which version of Word
are you using?

Signature

Peter Jamieson

> The following works fine:
>
[quoted text clipped - 19 lines]
>
> Bill

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.