BamaColtsFan
Registered User.
- Local time
- Today, 14:00
- Joined
- Nov 8, 2006
- Messages
- 91
Okay, I am using a simple loop and pulling together a list of data into a string value while trying to make it look like a table of information. Everything works pretty well except that I'm having trouble getting my columns to line up. I have used vbTab to seperate the columns and that works most of the time. The problem is that occasionally, the data can be significantly longer or shorter than average. For example, the name Doe, John is a lot shorter than Smith, Christopher and causes my tabs to get out of alignment. With that said, my question is this: How can I format my tabs (or my data) so that my columns remain consistient at all times?
As always, any advice is deeply appreciated!
Code:
Set myBatchList = db.OpenRecordset("qryBatchMailBody")
BatchList = "Name" & vbTab & vbTab & vbTab & vbTab & "ST" & vbTab & "Dept" & vbTab & "People Group" & vbTab & vbTab & _
"Status" & vbTab & "End Date" & vbCrLf
Do Until myBatchList.EOF
BatchList = BatchList & vbCrLf & myBatchList("Name") & vbTab & vbTab & myBatchList("SkillType") & vbTab & _
myBatchList("Dept") & vbTab & myBatchList("People Group") & vbTab & myBatchList("Status") & _
vbTab & Format(myBatchList("Timecard Stop Date"), "dd-mmm-yyyy")
myBatchList.MoveNext
Loop
As always, any advice is deeply appreciated!