PC Review


Reply
Thread Tools Rate Thread

vbcrlf not always kicking in

 
 
mike
Guest
Posts: n/a
 
      23rd May 2004
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



 
Reply With Quote
 
 
 
 
Cheryl Fischer
Guest
Posts: n/a
 
      24th May 2004
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



"mike" <(E-Mail Removed)> wrote in message
news:1106e01c44111$305da730$(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
mike
Guest
Posts: n/a
 
      24th May 2004
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
>
>
>
>"mike" <(E-Mail Removed)> wrote in

message
>news:1106e01c44111$305da730$(E-Mail Removed)...
>> 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
>>
>>
>>

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBCRLF not doing anything TheObstacleIsThePath@gmail.com Microsoft Excel Programming 3 16th Jan 2007 07:08 PM
vbCrLf Chris Microsoft VB .NET 8 26th Sep 2006 11:06 AM
vbCrLf ? ad Microsoft C# .NET 3 20th Jun 2005 03:13 AM
vbCrLf =?Utf-8?B?cm1s?= Microsoft Access Queries 2 22nd Dec 2004 08:52 PM
VBCRLF in C# Murali Inguva Microsoft C# .NET 8 2nd Sep 2003 11:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:51 PM.