Hi,
I need to load a string array from a single recordset field that contains vbCRLFs in VB6.
The idea is to break down these rs fields into lines so that I can create a neat plain text email with the information next to each other. (Don't know HTML yet)
So far I have this:
'InStrCount counts the amount of specified delimiters from a certain position
'Rsado is the name of the recordset
Dim bytI As Byte
Dim bytSplits As Byte
Dim strMN(15) As String
Dim varMN(15) As Variant
bytSplits = InStrCount(rsado!MN, vbCRLF, 1) + 1
For bytI = 0 To bytSplits
strMN(bytI) = Split(rsADO!MN, vbCrLf, bytI, vbTextCompare)
Next
This code keeps returning "runtime error 13 Type mismatch".
I have read a few articles and check out other code, none have the answer I need.
It does work if I use a variant array, but I can't see the information in the array. So I don't know if it's working or not.
Thanks
Start Free Trial