.AddNew Memo field problem

Full_Williams

Registered User.
Local time
Today, 03:08
Joined
Jul 2, 2002
Messages
88
Hi there,

I have a table with 6 memo fields and I want to add all the memo field data to a different table with 1 memo field. So I have some vb code that pulls out memo field1 data then adds to the new table then pulls out memo field2 data and adds to the new table etc. For some reason the data in the new table get's cut off. There seems to be a limit to the number or characters it'll allow to be added.

I use

rst0.addNew
rst0![Memo] = rst1![memo]
rst0.update

Does anyone have any ideas why this might be happening?

Full Williams
 
Full,

I'm not too clear on what you're doing, but maybe
this will help:

rst0.addNew
rst0![Memo] = rst1![memo]
rst0![Memo] = rst0![memo] & vbCrLf & rst2![Memo]
rst0![Memo] = rst0![memo] & vbCrLf & rst3![Memo]
' and so on ...
rst0.update

hth,
Wayne
 
Wayne,

Sorry if I wasn't clear. I have 6 memo fields in one table:
x1comments
x2comments
x3comments
x4comments
x5comments
x6comments

I'm trying to cosolidate this into one memo field in a new table. Taking all the x1comments and adding them to the new table then taking all the x2comments and adding them to the new table etc. The problem is that when the x1comment is added to the new table all the data from the field isn't getting added.

So I'll get "Sidewalks of S" in the new table instead of "Sidewalks of San Franciso". It's cutting off some of the data.

Hopefully that's more clear. Let me know if not and I'll try to explain more.

Thanks,
Full Williams
 
Full,

It sounds as if the "new" memo field isn't a memo
field after all. Check that first.

Can you run your code with the Debugger and inspect
your data? Just set a breakpoint and run it.

If it is a memo field then this technique should work:

rst0.addNew
rst0![Memo] = rst1![memo1]
rst0![Memo] = rst0![memo] & vbCrLf & rst1![Memo2]
rst0![Memo] = rst0![memo] & vbCrLf & rst1![Memo3]
' and so on ...
rst0.update

Wayne
 
Wayne,

It is a memo field in the new table. Double checked that.

So I'm not actually trying to combine the memo fields into 1 large memo field. I just want to add all the memo fields to the new table with one memo field. So If I have 1 record in the first table I should end up with 6 records in the new table only the new table will have one memo field.


Thanks,
Full Williams
 
Full,

Now I see what you are saying, but I don't like it.
I don't that replicating the rest of the fields in
your other records is a good move, but ...

Code:
While Not rst1.EOF And Not rst1.BOF
   rst0.addNew 
   rst0![SomeField] = rst1![SomeField]
   rst0![SomeOtherField] = rst1![SomeOtherField]
   rst0![Memo] = rst1![memo1]
   rst0.Update

   rst0.addNew 
   rst0![SomeField] = rst1![SomeField]
   rst0![SomeOtherField] = rst1![SomeOtherField]
   rst0![Memo] = rst1![memo2]
   rst0.Update

   ' Repeat for memo2 - memo5

   rst0.addNew 
   rst0![SomeField] = rst1![SomeField]
   rst0![SomeOtherField] = rst1![SomeOtherField]
   rst0![Memo] = rst1![memo6]
   rst0.Update

   rst1.MoveNext
   Wend

I think that you should still run it with the Debugger, cause
I don't know where the truncation occurs.

Wayne
 
Wayne,

I'm putting the memo fields in a new table because I need to view all the comments in a report listed out like this:

* comment
* comment
* comment
* comment
etc.

If you have any other suggestions on how I should go about this please let me know. I'm not sure why you don't like my approach.

Thanks
Full Williams
 
Full,

They don't have to be seperate records to be listed like that.
You can just stack them vertically and use the CanShrink and
CanGrow properties on them.

You could also (in your query) look at making a new
single-column:

NewMemo: Memo1 & vbCrLf & Memo2 ...

That would allow you to create one "composite" memo field. In
conjunction with the vbCrLf you could also insert text to be used
as "Headings" such as "Problem Descripton ..." or "Summary..."

Wayne
 

Users who are viewing this thread

Back
Top Bottom