Split function (1 Viewer)

dgkindy

Registered User.
Local time
Today, 02:43
Joined
Feb 22, 2007
Messages
34
I am using the split function to collect an array of values from a text box. Works great however, it appear that it maintains the delimiter value as well. I have tried to do a string search for Chr(13), which I believe is the correct value for a carriage return. I need to only capture the text or remove the CR from the string.

An example of date:

test.pdf (CR)
test2.pdf(CR)

When the split function runs it appears that I am capturing the text in the following way:

record 1 test.pdf
record 2 (CR)test.pdf


If Me.txtManual.Value <> "" Then Lit = Split(LitString, Chr(13))
rs.MoveFirst
Do
If Not Me.txtManual.Value = "" Then
For X = 0 To UBound(Lit)
With rslit
.AddNew
!PartID = rs!PartID
!Literature = Lit(X)
.Update
End With
Next X
End If
rs.MoveNext
Loop Until rs.EOF
 

RuralGuy

AWF VIP
Local time
Today, 00:43
Joined
Jul 2, 2005
Messages
13,826
Is is possible your data is separated by a CrLf sequence? Chr(13) & Chr(10) You might try using the Replace() function to replace the vbCrLf with a single character of your choosing first before using the Split() function.
 

Users who are viewing this thread

Top Bottom