I'm reading a record from an access database. In one record, I have some tab and carriage return delimited information. Specifically, Name<tab>Address<return>Name<tab>Address<return> etc. Well, I'm then using that data to merge into a word document, so I needed to add formatting. So, now it looks like this... Name<tab>Address<return><tab><tab>Name<tab>Address<return>. When trying to populate back into the datagrid, I first split on the CrLf and then on the Tab. Well, after doing that my first character of my second line is a tab. I want to skip that in my processing. I've tried multiple ways of skipping, but to no avail.
I've tried
and so on.
sTemp2 is a square in quotes... so is vbTab. I'm not sure what else to try.
Thanks - Todd
Code:
sRows = sData.Split(vbCrLf)
For Each sTemp In sRows
sColumns = sTemp.Split(vbTab)
i = 0
dgViewRow = New DataGridViewRow
dgViewRow.CreateCells(dbDataGrid)
For Each sTemp2 In sColumns
sTemp2 = Replace(sTemp2, ControlChars.Tab, "")
If sTemp2 <> vbTab Then
dgViewRow.Cells(i).Value = sTemp2
i += 1
End If
Next
dbDataGrid.Rows.Add(dgViewRow)
Next
I've tried
Code:
If sTemp2 <> controlchars.tab
Code:
If cchar(sTemp2) <> controlchars.tab
Code:
If sTemp2 <> vbTab
Code:
If cchar(sTemp2) <> vbTab
Code:
If sTemp2 <> chr(9)
Code:
replace(stemp2, vbTab, "")
sTemp2 is a square in quotes... so is vbTab. I'm not sure what else to try.
Thanks - Todd