Memo Field to Text Field Conversion

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

Is there a way to convert a memo field that is longer
than 255 characters to mulitple text fields (ie the first
255 characters to a text field, then the remaining
characters to another text field).
 
Check out the GetChunk method of the Recordset Object
(Requires VBA programming)
HTH

Pieter
 
Scott said:
Is there a way to convert a memo field that is longer
than 255 characters to mulitple text fields (ie the first
255 characters to a text field, then the remaining
characters to another text field).

Suppose for a simple example that you have a table like this:

Table1
-------
ID (primary key)
MemoField (data type memo)
TextField1(data type text)
TextField2(data type text)
TextField3(data type text)

Then I think you could run an update query like this:

UPDATE Table1 SET
TextField1 = Left(MemoField, 255),
TextField2 = Mid(MemoField, 256, 255),
TextField3 = Mid(MemoField, 511, 255)
WHERE MemoField Is Not Null;

That should give you zero-length strings for those text fields beyond
the end of the memo text. If you don't like that, you can run update
queries later to set such fields to Null.
 
Back
Top