VBA line feeds in memo field

  • Thread starter Thread starter Pendragon
  • Start date Start date
P

Pendragon

Access03/WinXP

From a query I am trying to programatically set a group of records for the
same person into a single string and write to a memo field. For example,

John Smith Wed 10:00AM Room 1
John Smith Thurs 1:00pm Room 2C
John Smith Fri 3:30pm Room 7B

becomes

John Smith Wed 10:00AM Room 1 // Thurs 1:00pm Room 2C // Fri 3:30PM Room 7B

This I have down. There are enough records that the string is being written
into a memo field of a temp table (from which a report is run) and in order
to make clean breaks, I am trying to insert a line feed after each set of 3
records. Using vbLF, chr(10) or chr(13), I keep having square boxes show up.
Is this symptomatic of using a memo field? What else should I try?

y=1
If y <= 3 Then
strObserverInfo = strObserverInfo & rsObservers("ClassDay") & ",
" & rsObservers("ClassTime") & ", " & rsObservers("RoomNumber") & " // "
y = y + 1
Else
strObserverInfo = strObserverinfo & vbLf ' or chr(10) or
chr(13)
strObserverInfo = strObserverInfo & rsObservers("ClassDay") & ",
" & rsObservers("ClassTime") & ", " & rsObservers("RoomNumber") & " // "
y = 1
End If

The data is written to the temp table without a problem. I'm only trying to
figure out how to format the data within the memo field for each record so
that on the report there are clean breaks after each set of 3.

Thanks for any assistance.
 
vbcrLF should do the trick.


me.MyMemoBox = "one" & vbCrlf & "two" & vbcrlf & "Three"

should produce in the box:


one
two
three
 
Back
Top