I can't imagine a macro doing something that a function can't do in a query.
--
Duane Hookom
MS Access MVP
Jeri Morris said:
the query?
Unfortunately, no. The computation is way too complex.
Actually, the "computation" is a set of string substitutions. The code
scans a string taken from the database for certain tags, and replaces the
tags with data from various tables in the database, and uses the resulting
string in the report. For example, if the string in the database is:
"Student <!StudentName>, living at <!StudentAddress>, paid <!Tuition> in tuition."
the code might replace that with:
"Student John Doe, living at 1 Park Plaza, New York, NY, paid $10,000 in tuition."
Since I can't predict what the string containing the tags will look like
(the user is allowed to change it), the code has to fetch it from the
database, do the tag substitution, then display the result in the report.
I was modifying a report created by someone else when I posted my message.
The original report used hard-coded text. I changed it to pull the text from
a table instead (without adding the complexity of the string substitution
yet), but then ran into the problem I described earlier when I tried to
export the report to Word. However, when I created a new report from scratch
and set it up the same way as the original report (or so I think), I
*didn't* have a problem exporting the report to Word--all the text shows up.
Given that the two reports behave differently when exported to Word, there
must be some difference betwen the original report and the new one that I
can't see (yet). Any thoughts on what that difference might be?