Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access & mail merge: print all records and selected memo fields

Status
Not open for further replies.

Wizdar

Technical User
Sep 4, 2002
86
US
Trying to mail merge data from a query. I want to print all records and include [MemoField] if [Yes/NoField1] is yes, AND if [Yes/NoField2] is yes. Otherwise I want the data in the memo field to not print.

Unfortunately, I’m horribly challenged when it comes to writing these types of statements. Any help is greatly appreciated.
 
So you should limit your query, maybe try:

SELECT FieldOne, FieldTwo, "" as MemoField WHERE YNField1 = "No" AND YNField2 = "No"
UNION
SELECT FieldOne, FieldTwo, MemoField WHERE YNField1 = "Yes" AND YNFeidl2 = "Yes"

should prepare those that have 2 NO's with blank memofields (regardless of what is actually in the record the query will have a "") and the 2 YES's will have the memofield.

HTH



Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!
 
I found a way to eliminate one of the yes/no fields (realizing that one was unnecessary) and came up with:

queryitem: iif([tablename].[Y/Nfieldname]] = -1,[tablename].[memofieldname])

Unfortunately, the output (to WordXP) is limited to 255 characters. When I insert the memo field itself into the mail merge, the output is complete. But then the yes/no conditions do not work.
 
I had the same problem with a large field. What I ended up doing was creating a bookmark in Word named bmText. When I insert the information I actually put it just past the bookmark (this is from my Delphi code, it will be just a little different coming from Access):

R := Word.ActiveDocument.Bookmarks.Item("bmText").Range;
R.InsertAfter(strData);

HTH
Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top