Concatenate memo fields without SQL

Alexandros

New member
Local time
Today, 18:05
Joined
Feb 9, 2012
Messages
5
Hello,
I have a report connected to a query. That query has an expression column that concatenates several fields. 1 memo and like 8 text. As you understand concatenation causes characters beyond 255 to be truncated since access treats them as text during the concatenation and not as memo.
I found 2 threads with a solution but both were using SQL which I do not know.
Im familiar with programming but not with SQL. Is there a way to make the expression field in my query display over 255 characters resulting from concatenating fields?
Thanks in advance
 
Why don't you concatenate with VBA?
SQL would be useful to do this with recordsets, but I believe you could circumvent using SQL with the use of DLookup.

Declare a string, concatenate your fields then use it as row source for whatever control you need in the report (textbox, likely?).

Code:
Dim myFinalTXT as String

myFinalTXT = Nz(DLookup("memofld", "tbl", [optional condition]), "")
myFinalTXT = myFinalTXT & Nz(DLookup("txtfld1", "tbl", [optional condition]), "")
myFinalTXT = myFinalTXT & Nz(DLookup("txtfld2", "tbl", [optional condition]), "")
'and so forth.
'you might want to concatenate " " white spaces or whatever character you need to separate your content.
 
Hmm that one seems more doable. I normally program in java but vba seems piece of cake for that. I will try that and let you know if it worked.
Thanks again
 

Users who are viewing this thread

Back
Top Bottom