I'm working with a table with a large number of fields (40+) in which each record has some fields that need to be filled with "custom" data (based on the results of the program) and the rest need the same "default" values entered repeatedly. I'm writing this program in VBA through MS access.
The actual syntax of creating a new record with field entries is not a problem, but I'm not sure of the best way to enter the most efficient/readable code for all these default entries. Since there's no way to refer to SQL fields using only the column location, I'm thinking the code will quickly turn ugly when referring to each field by a human readable name.
My current code is
DoCmd.RunSQL "INSERT INTO Table1 ([PartNumber],[Description],[Alternate],[Supplier],[Location],[Rev]) values('" & PartNumber & "','" & Description & "'," _
& " '" & Alt & "', '" & Supplier & "', '" & Location & "','" & Rev & "')"
So this is going to get ugly with 35+ more values.