Line up Output data in a text file?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to create a string of data from a recodset but have all of the fields
line up in my output. How do I do this?

do until rst.eof
strResult = strResult & rst("Name") & " " & rst("Age") & " " &
rst("Birthday")& " " & rst("Job")

strResult = strResult & vbcrlf

I want the output to look like the following:

Jonathan 32 02/16/73 Office Manger
Jan 28 05/03/77 Clerk

Instead of:

Jonathan 32 02/16/73 Office Manger
Jan 28 05/03/77 Clerk
 
if you use proportional font, like courier, then you can write a function
which adds spaces after string, like:

rst("Name") & string(" ", 15-len(rst("Name"))) '- will add space so toral
will be 15 characters

else you can try to use tabs in between, vbTab
 
Hi,
this is a tricky one. for example Outlook set courier by default for all
plain messages. so if you just send plain email - then it will show
correctly in outlook. but of course, user can change, this you can't control
 
Back
Top