I am trying to write to an editable database table, from an Access form, and I keep receiving a syntax error.
The table has about 30 columns, but I only want the record filling out 8 of them: (Job #
, Job Name
, Date
, Superintendent
, Hauling Vendor
, Material
, LTC
, Loads
).
The form consists of the 8 fields named the following:
ReportingCOM_Job
ReportingBox_JobName
ReportingBox_Date
ReportingCom_SI
ReportingCom_Vendor
ReportingCom_Mat
ReportingCom_LoadType
ReportingBox_Loads
These are a combination of drop down list from queries, text inputs, and hard coded values, so a simple Open Form > New Record will not work here; or so I do not believe.
Is this even even possible?
I am using the following line and can not get this error to clear.
CurrentDb.Execute "INSERT INTO MATLog(Job #, Job Name, Date, Superintendent, Hauling Vendor, Material, LTC, Loads) " & _
" VALUES(" & Me.ReportingCOM_Job & "," & Me.ReportingCom_JobName & ",#" & Me.ReportingBox_Date & "#," & _
Me.ReportingCom_SI & "," & Me.ReportingCom_Mat & "," & Me.ReportingCom_Vendor & "," & Me.ReportingCom_LoadType & ",#" & Me.ReportingBox_Loads & "#)"
This form should create a new record with these 8 fields, and leave the rest blank.