I use a series of if-then statements to decide which columns to export data to. These column names are saved in strings. I need the string to read out, so that the INSERT statement retrieves the column name from the string and saves in there. I've been reading on string functions but without luck. Anyone know how to do this?

INSERT INTO [FPAD Process Log] ([Lot Number], [Assigned Engineer], [Engineer Log], [Tool Type], Process, [Wafer/Slice], Quantity, [Job Entry Log], @str1, @str2, @str3, @str4, @str5]) VALUES (@LotNumber, @ChargeNumber, @AssignedEngineer, @Engineer_Log, @Tool_Type, @Process, @Wafer, @Quantity, @time,@txt1, @txt2, @txt3, @txt4, @txt5)