By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,306 Members | 1,673 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,306 IT Pros & Developers. It's quick & easy.

Formatting a String Variable into columns

P: n/a
Rob
Hey folks,

I should be ashamed for not knowing the answer to this question -
but I don't get the opportunity to program all that much anymore...

I have a data tracking program used by over 150 users (not all at
once) and works with no problems. Every once in a while,I add some
functionality. When the user updates a record,I want Access to send
the next individual in the chain an email telling them it is their
turn to due the update. Easy stuff -- but the text formatting is
horrible:

7 Feb 08 Some Stuff etc,etc
8 Feb 08 Even more stuff etc,etc
9 Feb 08 Some Stuff etc, etc
10 Feb 08 Even more and more stuff etc,etc

You get the idea (columns)

Right now,I take the data from a query and put it into a
multidimensional (variant) Array.
I then populate a String variable with the info from the array. What
I want to do is format the data (in the string) to fit neatly into
columns. How can I do that?

My IT guys have cut off Outlook functionality; we can only send in
text format (no formatting)

Here's a sample of my code that populates the String then sends it to
Outlook:

For intRow = 0 To lngNum_Records
If intRow = lngNum_Records Then
GoTo End_Slides
End If

For intColumn = 0 To 4

If IsNull(vMyRecords(intColumn, intRow)) Then
strTest = strTest + vbTab + " "
Else
strTest = strTest + vbTab + CStr(vMyRecords(intColumn,
intRow))
End If

Next intColumn
strTest = strTest + vbCrLf
Next intRow

End_Slides:

DoCmd.SendObject , , , , , , "This is a test", strTest, True

Anyone have any pointers? I don't get much programming time these
days and my abilities are fading LOL!

Thanks in advance

Rob
Feb 7 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Thu, 7 Feb 2008 05:45:46 -0800 (PST), Rob
<rm*****@oasis.mediatti.netwrote:

Rather take the query and use it as the basis for a report. Then you
can email that report with one line of code: DoCmd.SendObject.

-Tom.

>Hey folks,

I should be ashamed for not knowing the answer to this question -
but I don't get the opportunity to program all that much anymore...

I have a data tracking program used by over 150 users (not all at
once) and works with no problems. Every once in a while,I add some
functionality. When the user updates a record,I want Access to send
the next individual in the chain an email telling them it is their
turn to due the update. Easy stuff -- but the text formatting is
horrible:

7 Feb 08 Some Stuff etc,etc
8 Feb 08 Even more stuff etc,etc
9 Feb 08 Some Stuff etc, etc
10 Feb 08 Even more and more stuff etc,etc

You get the idea (columns)

Right now,I take the data from a query and put it into a
multidimensional (variant) Array.
I then populate a String variable with the info from the array. What
I want to do is format the data (in the string) to fit neatly into
columns. How can I do that?

My IT guys have cut off Outlook functionality; we can only send in
text format (no formatting)

Here's a sample of my code that populates the String then sends it to
Outlook:

For intRow = 0 To lngNum_Records
If intRow = lngNum_Records Then
GoTo End_Slides
End If

For intColumn = 0 To 4

If IsNull(vMyRecords(intColumn, intRow)) Then
strTest = strTest + vbTab + " "
Else
strTest = strTest + vbTab + CStr(vMyRecords(intColumn,
intRow))
End If

Next intColumn
strTest = strTest + vbCrLf
Next intRow

End_Slides:

DoCmd.SendObject , , , , , , "This is a test", strTest, True

Anyone have any pointers? I don't get much programming time these
days and my abilities are fading LOL!

Thanks in advance

Rob
Feb 7 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.