I have a note field, a memo field, and a memo2 field that I need to merge together into one column. They're essentially the same thing (just notes). Is there a way to do this in access and/or excel?
It it were not for the fact you are using a memo field, the answer would be a qualified yes. Memo fields are more like objects, and are not really part of the table.
LittleSmudge is putting together a documentation FAQ on Memo fields.
thread700-651285 guess the one saving grace is that with Access XP / 2002, you can apparently treat the first 255 characters of a memo field as a text field. (I have not done this -- but it is docuemnted)
How to...
Append the strings using the "&" syntax...
strText = strText1 & " " & strText2
In this example, I inserted two spaces between Text1 and Text2.
What about physically merge the three columns into a new one in the table? So instead of having three columns queried to one, put them together into one universal column.
I'm reading the post as a one time instance of doing this and not something on the fly. (because he mentioned doing it in Excel as an alternative) So in which case you can do a make table of all the fields except the 3 text fields, combine the text fields and write that one. Or you could add a 4th text field in the table defination and do an update table to build it then just delete the other 3 columns.
Well Willir, I don't really understand your example but I fixed it by manually merging the entries (it was only about 400 entries of copy and paste no big deal) but for future reference, in case I have 10,000 entries, here's what I was asking. Basically this is a document database that some how was created with three "Note" fields. The "Note" field is just to write down any extraneous comments or heads up in case the document is special, stored in another place, lost, etc.. I don't know why there's three note fields but only one is necessary, the rest are just junk. So I wanted to take all three fields and merge them as one. I won't get the problem you described above with strings bumping into each other (Jack loves applesJohn loves bananasSue likes dogs) because each record only has ONE "Note" field filled in. So basically with each entry, I'm trying to automatically eliminate the empty "Note" fields so essentially there will be one singular note field left for all records. This is really hard to explain but that's the best I could do. Don't worry about the response I guess, it's fixed and it didn't take too much time.
AlanKW's response is correct for the future...just do a make-table query where you make all of the fields currently in the table except for the 3 note fields...then add another column like this:
From your example, you just wanted to append the Notes together.
The basic syntax, as provided in varations is...
Notes1 = Note1 & Note2 & Note3
One variation on a solution is to put the following code behind a command button.
[blue]
Dim dbs as DAO.database, rst as DAO.recordset
Dim strNote as String
set dbs = currentdb()
set rst = dbs.openrecordset("YourTableName"
rst.MoveFirst
Do until rst.EOF
strNote = ""
if not isnull(rst!Note1) then strNote = strNote & rst!Note1
if not isnull(rst!Note2) then strNote = strNote & rst!Note2
if not isnull(rst!Note3) then strNote = strNote & rst!Note3
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.