vbcrlf not always kicking in

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

hi. i'm baffled. i have some code that loops through
records, puts them in a list an email message, and puts a
return after each record in the list. this works very well
except that sometimes the vb does not put a return between
records and i end up with two records on the same line of
the email message. it's almost like it doesn't recognize
the vbcrlf sometimes. any thoughts? thanks!!

Accounts = ""

Set rs = db.OpenRecordset("SELECT * FROM Accounts")

If Not rs.EOF Then
Do While Not rs.EOF

Accounts = Accounts & rs![AccountNumber] & " - " & rs!
[AccountName] & " (" & rs![City] & ", " & rs![State] & ")"
& vbCrLf & _
" " & rs![FROMTerritory] & rs![TOTerritory]
& vbCrLf

rs.MoveNext

Loop
End If
 
Mike,

I can offer only anecdotal 'evidence' ... I've found that vbCRLF is often
not recognized when creating an email message in code. However, Chr(13) &
Chr(10) has never failed.
 
Cheryl, I still end up with the same problem. Thanks for
the suggestion though.
-----Original Message-----
Mike,

I can offer only anecdotal 'evidence' ... I've found that vbCRLF is often
not recognized when creating an email message in code. However, Chr(13) &
Chr(10) has never failed.

--

Cheryl Fischer, MVP Microsoft Access



hi. i'm baffled. i have some code that loops through
records, puts them in a list an email message, and puts a
return after each record in the list. this works very well
except that sometimes the vb does not put a return between
records and i end up with two records on the same line of
the email message. it's almost like it doesn't recognize
the vbcrlf sometimes. any thoughts? thanks!!

Accounts = ""

Set rs = db.OpenRecordset("SELECT * FROM Accounts")

If Not rs.EOF Then
Do While Not rs.EOF

Accounts = Accounts & rs![AccountNumber] & " - " & rs!
[AccountName] & " (" & rs![City] & ", " & rs![State] & ")"
& vbCrLf & _
" " & rs![FROMTerritory] & rs![TOTerritory]
& vbCrLf

rs.MoveNext

Loop
End If


.
 
Back
Top