473,614 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
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
Feb 7 '08 #1
1 1980
On Thu, 7 Feb 2008 05:45:46 -0800 (PST), Rob
<rm*****@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
Feb 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5924
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 terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both of them are mentioned in the bug list on the access
0
2931
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 separate sheet within spreadsheet is created. Particular fields are selected. User requires fields to be auto-fitted. Problem, is that some tables have more than 1200> rows. Code generates error message. Is there a way of getting around this...
3
2306
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 five weeks of sales for each category by using a conditonal format to highlight these top five weeks. I've been trying to find a way to do this but have not been sucessful looking through many books on Access and in reading the user groups. If...
3
18700
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 with only 2 decimals (#,##0.00)? In the sample below, amount and taxrate are existing DataColumn's. DataColumn colTax = new DataColumn(); colTax.DataType = System.Type.GetType("System.String"); colTax.ColumnName = "tax";...
0
1505
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 or three, etc. The trick to this, is that String.Format offers powerful formatting functionality, so this seems like an obvious choice. BUT- strings do not sort well in a datagrid (using the .sort property of a dataview object and then binding...
2
2694
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 information is lost, i.e. converted to a string. So my question is: is it better to format data while it's still in a DataTable, for example, then bind it to the control, or format the strings in the BoundField elements, or if more flexibility is...
4
8321
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 date column always shows the date and time while I just want the short date. I have tried applying a format string {0:d} but to no avail. I saw a lot of posts regarding the htmlencode property but I do not know how to turn that off for a...
7
16403
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 they can only input numerical values. Is there any way to do this? Currently my formatting works but if the user enters a value manually the formatting is not applied to the new value. Also I haven't found a way to allow only numerical input....
10
9666
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 each tab and apply autowidth to columns and apply autofilter to the first row of every tab in the workbook. I've this down
0
8142
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8640
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8287
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4136
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.