Thanks for the reply Jonh, based on your feedback my code now looks like this. I should also mention i am using access2007-2013 formatting if that matters at all. This code is being inserted on a runtime application on a computer, and the access file is located on the same computer. When I execute this code however, nothing seems to write to the access data base. The database is already created and ready to go. Is there anything i am missing in this code ?
With CreateObject("ADODB.Connection")
.connectionstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Administrator\Desktop\HMI\ExcelRevs\PLCDataBase.accdb;"
.open
'.execute "insert into table6 PLCDataT1(field2,field3,field4) values ('" & SmartTags("OEEShift")& ",'" & 2 & "','" & SmartTags("UPTIME") & ")"
.execute "insert into table6 (field2,field3,field4,field5,field6,field7,field8,field9,field10,field11,field12,field13,field14,field15,field16,field17) values ('" & SmartTags("OEE_Date")& "','" & SmartTags("OEE_Time") & "','" & SmartTags("OEEShift")& ",'" & 2 & "','" & SmartTags("UPTIME")& "','" & SmartTags("DOWNTIME")& "','" & SmartTags("#ofDowntime")& "','" & SmartTags("OEERecipe")& "','" & SmartTags("OEEPPTime")& "','" & SmartTags("OEEUPTime")& "','" & SmartTags("OEEDOWNTIME")& "','" & SmartTags("OEEGoodParts")& "','" & SmartTags("OEEBadParts")& "','" & SmartTags("OEETotalParts")& "','" & SmartTags("OEE%")& "','" & SmartTags("CycleTimeAverages_AverageTime") & ")"
.close
End With