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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record code

Status
Not open for further replies.

vicktown2

Technical User
Aug 19, 2004
7
CA
Using a report I would like a text box to show information from a memo field if the field is not empty, and to show a brief message if it is empty.
I have run into truncation problems when using an expression using the IIF commands and the Nz command because these commands only work with Text type data (255 characters) and not Memo(thousands of characters).
Therefore i believe that a small piece of coding using an event procedure might help. But i fear that the same truncation coding might happpen. Nevertheless, does anyone have any good ideas about the coding i should use?
 
You could count the length of the string:

=IIf(Len(MyField)>0,"Memo exists", "Memo doesn't exist)

HTH

Joe Miller
joe.miller@flotech.net
 
This would work if i wanted to know if it existed , but i actually want to print the memo to a record. If I call the memo in this statement Access will show it as a text value and thus truncate the memo.

 
Replace my message of "Memo Exists" with the fieldname of the memo you want to show.

=IIf(Len(MyField)>0,MyField,"Memo doesn't exist")

Joe Miller
joe.miller@flotech.net
 
Thats what i just said doesnt work. By using the IIF command access automatically returns a test value that can only fit 255 characters. WHat i need is a similar command or routine that will return a memo value of up to 64,000 characters.

Thanks for the effort.
So far things that dont work: IIF, and Nz statements.

The help menu claims that i need to use OLE's (word files or similar) to store these values, but i already have a data base full of many memos so i hope to work around this.
 
This does work, I've used it many times and tested it prior to posting. Are you sure you set the CanGrow property of the control displaying your memo to "Yes"?



Joe Miller
joe.miller@flotech.net
 
Where exactly are you putting this line. As the control source? or somewhere else on teh report or query?
 
Ok it seems like everythign is working well now. Thanks for your help pal.

 
I did it in the query feeding the report originally. But after reading your post, I tested it in the control in the report and it worked both places.

If it still doesn't work, what version of Access are you using?

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top