Case "DIN"
' Add date in factory if DIN
splitText1 = Split(txtLine, "=")
splitText2 = Split(splitText1(1), "+")
strChange2 = splitText2(0)
output = output & "Depot Date " & " - " & Right(strChange2, 2) & "/" & Mid(strChange2, 3, 2) & "/" & Left(strChange2, 2) & vbCrLf
If DCount("DepotDate", "OrderInfo", "DepotDate='" & strChange2 & "'") = 0 Then 'DCount determines DepotDate in the OrderInfo table is 0 (empty)
strSQL = "INSERT INTO OrderInfo (DepotDate,OrderDate,OrderNo) VALUES ('" & strChange2 & "' & strChange1 '" & splitText3(1) & "')"
DoCmd.RunSQL strSQL 'If it is empty run the SQL INSERT INTO statement
End If
|