title: Using variables in fieldnames - SQL Update statement
body: <p>I am new to using Access 2010. I wish to execute the following sql update statement, but I have problems with the syntax. The table is called "Forecasts", and users will edit &amp; update the qty forecasted.</p>
  
  <p>Problem - The table fieldnames are 2014_1, 2014_2, 2014_3 ... to represent the different months, stored in an array. I have done abit of research and I believe the way to dynamically do this is:</p>
  
  <pre><code>Dim sqlString As String
      sqlString = "UPDATE Forecasts " &amp; _
      " SET Branch_Plant=" &amp; Me.txtBranch_Plant &amp; _
      ", Item_Number_Short='" &amp; Me.txtItem_Number_Short &amp; "'" &amp; _
      ", Description='" &amp; Me.txtDescription &amp; "'" &amp; _
      ", UOM='" &amp; Me.txtUOM &amp; "'" &amp; _
      ", Estimated_Cost=" &amp; Me.txtEstimated_Cost &amp; _
      ", Requesting_Business_Unit='" &amp; Me.txtRequesting_Business_Unit &amp; "'" &amp; _
      ", End_Customer='" &amp; Me.txtEnd_Customer &amp; "'" &amp; _
      ", Project='" &amp; Me.txtProject &amp; "'" &amp; _
      ", Forecasts." &amp; "[" &amp; arrMonthToDisplay(0) &amp; "]" = " &amp; Me.txtProjectedJanVolume " &amp; _
      " WHERE ID =" &amp; Me.txtID.Tag
  
      MsgBox ("This is the output: " &amp; sqlString)
      CurrentDb.Execute sqlString 
  </code></pre>
  
  <p>It was working fine until this line was added</p>
  
  <pre><code>Forecasts." &amp; "[" &amp; arrMonthToDisplay(0) &amp; "]" = " &amp; Me.txtProjectedJanVolume
  </code></pre>
  
  <p>The msgbx output now shows: "False". Whats wrong with sqlString?</p>
  
  <p>Please help! Thank you very much.</p>