Hello,
I am new to this community but would like to get direction on how to insert colons
) into the database through a vba insert statement.
Here is my code sample. I am using an array with a user defined type so I can Redim Perserve the 2 dimensional array. Again the problem is that when I have any ":"s in the data the insert statements fail. Can someone tell the syntax to wrap the colon in so that it is accepted? THANKS IN ADVANCE FOR YOUR HELP!
Code sample:
For X = 1 To UBound(strLabsArray)
'MsgBox X & "_" & strLabsArray(X).Fields(1) & "_" & strLabsArray(X).Fields(2)
If strLabsArray(X).Fields(1) = "" Then Exit For
strSql = "INSERT into [tblLabs] ([Lab Code], Payer, [GL Code], TaxID, [Begin Date], [End Date], [Lab Name], Street, City, State, Zip, NPI, Clia, [Pay To], [Tax-ID])" _
& " Values ('" & strLabsArray(X).Fields(1) & "', '" & strLabsArray(X).Fields(2) & "', '" & strLabsArray(X).Fields(3) & "', '" _
& strLabsArray(X).Fields(4) & "', '" & strLabsArray(X).Fields(5) & "', '" & strLabsArray(X).Fields(6) & "', '" _
& strLabsArray(X).Fields(7) & "', '" & strLabsArray(X).Fields(8) & "', '" & strLabsArray(X).Fields(9) & "', '" _
& strLabsArray(X).Fields(10) & "', '" & strLabsArray(X).Fields(11) & "', '" & strLabsArray(X).Fields(12) & "', '" _
& strLabsArray(X).Fields(13) & "', '" & strLabsArray(X).Fields(14) & "', '" & strLabsArray(X).Fields(15) _
& "');"
CurrentDb.Execute strSql
Next
I am new to this community but would like to get direction on how to insert colons

Here is my code sample. I am using an array with a user defined type so I can Redim Perserve the 2 dimensional array. Again the problem is that when I have any ":"s in the data the insert statements fail. Can someone tell the syntax to wrap the colon in so that it is accepted? THANKS IN ADVANCE FOR YOUR HELP!
Code sample:
For X = 1 To UBound(strLabsArray)
'MsgBox X & "_" & strLabsArray(X).Fields(1) & "_" & strLabsArray(X).Fields(2)
If strLabsArray(X).Fields(1) = "" Then Exit For
strSql = "INSERT into [tblLabs] ([Lab Code], Payer, [GL Code], TaxID, [Begin Date], [End Date], [Lab Name], Street, City, State, Zip, NPI, Clia, [Pay To], [Tax-ID])" _
& " Values ('" & strLabsArray(X).Fields(1) & "', '" & strLabsArray(X).Fields(2) & "', '" & strLabsArray(X).Fields(3) & "', '" _
& strLabsArray(X).Fields(4) & "', '" & strLabsArray(X).Fields(5) & "', '" & strLabsArray(X).Fields(6) & "', '" _
& strLabsArray(X).Fields(7) & "', '" & strLabsArray(X).Fields(8) & "', '" & strLabsArray(X).Fields(9) & "', '" _
& strLabsArray(X).Fields(10) & "', '" & strLabsArray(X).Fields(11) & "', '" & strLabsArray(X).Fields(12) & "', '" _
& strLabsArray(X).Fields(13) & "', '" & strLabsArray(X).Fields(14) & "', '" & strLabsArray(X).Fields(15) _
& "');"
CurrentDb.Execute strSql
Next