Formatting a String Variable into columns

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rob

    Formatting a String Variable into columns

    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
    multidimensiona l (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(vMyRecor ds(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.SendObjec t , , , , , , "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
  • Tom van Stiphout

    #2
    Re: Formatting a String Variable into columns

    On Thu, 7 Feb 2008 05:45:46 -0800 (PST), Rob
    <rmfoley@oasis. mediatti.netwro te:

    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.SendObjec t.

    -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
    >functionalit y. 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
    >multidimension al (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(vMyRecor ds(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.SendObje ct , , , , , , "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

    Comment

    Working...