I am getting an error with this code. It says there is a syntax error near "," which is pretty useless. I am almost positive is has to do with the NULL statements.
VB Code:
Dim sqlinsert As String sqlinsert = "INSERT INTO PENDINGART ([CUST], [PRTD], [CUSTART], [DESC], [DATEREC], [SIZE], [DATERQD], [STATUS], [SAMPLENEEDED], [NOTES]) VALUES(" sqlinsert = sqlinsert & "'" & XCUST & "', " sqlinsert = sqlinsert & "'" & Xprtd & "', " sqlinsert = sqlinsert & "'" & Xcustart & "', " sqlinsert = sqlinsert & "'" & xDESC & "', " If IsDate(XDATEREC) Then sqlinsert = sqlinsert & "'" & XDATEREC1 & "', " Else sqlinsert = sqlinsert & Null & ", " End If sqlinsert = sqlinsert & "'" & xSIZE & "', " If IsDate(Xdaterqd) Then sqlinsert = sqlinsert & "'" & XDATERQD1 & "', " Else sqlinsert = sqlinsert & Null & ", " End If sqlinsert = sqlinsert & "'" & xstatus & "', " sqlinsert = sqlinsert & "'" & XSAMPLENEEDED & "', " sqlinsert = sqlinsert & "'" & xnotes & "') " CnxnTechSQL.Execute sqlinsert


Reply With Quote
