473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Formatting a String Variable into columns

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
1 1965
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
0
by: ImraneA | last post by:
Hi there Have a database, where front-end interface allows user to select a ms access database. From there, standard tables are linked. Routine, that creates a spreadsheet, for each table a...
3
by: Chuck Reed | last post by:
I am working on a sales report where I show weekly sales by category for each of the 52 weeks in the year. Each record in my table/report has the 52 weeks of sales in it. I want to highlight to top...
3
by: J | last post by:
Is there anyway to format a calculated datacolumn? I would like the following column to display as money (formatted as $#,##0.00). Or how about simply displaying the column formatted as a number...
0
by: Josh Harris | last post by:
Here is my issue: I have a datagrid that is populated with a datatable. I want the columns of the datagrid to be sortable. I also want to format the numeric columns such as two decimal places...
2
by: J055 | last post by:
Hi I've been looking into different ways of formatting columns/rows in the GridView control. I realize now, I think, that once the datasource is bound to the control the original column type...
4
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the...
7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
10
by: afromanam | last post by:
Regards, Please help What I'm trying to do is this: (and I can't use reports since I must export to Excel) I export some queries to different tabs in an excel workbook I then loop through...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.