View Single Post
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Chris Chris is offline
external usenet poster
 
Posts: 237
Default Binary Operation in INCLUDEPICTURE Field

Ah, unfortunate.
Unless I'm missing something, creating calculated fields via the SQL
statement provides no benefit over the way I'm already using that works
(Method 3). It's just doing the calculation and possibly creating the full
image URL in the select statement rather than when it processes the
INCLUDEPICTURE tag. This still relies on a static path in the Word document
(which is okay, but undesirable if avoidable).

Yeah, it'd be cleaner if I could get DDE working but it indeed appears to be
quite temperamental. I dont' receive VBA macro warnings anymore when I open
the DB and use it normally (I believe I disabled them), so I don't think that
would cause the DDE problem.

I guess I could just solve the static path issue by making another table
with the normal path as a row.

If you've got no other advice,
Thanks again for all the help Peter.

"Peter Jamieson" wrote:

OK, I really meant "use predefined VBA functions etc. in your query". If you
use your own VBA function then you have no option but to use DDE to get the
data. Because that creates other problems it is probably best avoided.

Unfortunately, you cannot use VBA's "and" operator as a bitwise operator
within a Jet SQL query - it is always treated as the logical operator. So
you have to do something like

SELECT (myfield\4) mod 2 AS [mynewfield], *
FROM mytable

Then you should be able to connect via OLE DB (the default - you may still
be able to use ODBC but there are likely to be problems with the file
extension .accdb )

(Just in case you are having problems getting VBA functions to work in SQL
queries, you will probably need to ensure that your database is in a trusted
location to get VBA functions, even when you are working within the database
itself).

Peter Jamieson