title: change a field's value with vba
body: <p>I want to change a date in a specific table to today's date by clicking a button in a related form.  So all the button does is changing the date in a certain field in my DB. Is there a simple way to do this with VBA?</p>
  <p>*Update</p>
  <p>Well I wrote this in my VBA code:</p>
  <pre><code>CurrentDb.Execute &quot;UPDATE Machines SET LastMaintenance = Date() WHERE MachineID = MachineID.Value&quot;
  </code></pre>
  <p>With &quot;<code>Machines</code>&quot; being my table, &quot;<code>LastMaintenance</code>&quot; the column containing the date that has to be changed into today's date, &quot;<code>MachineID</code>&quot; the name of the record and &quot;<code>MachineID.Value</code>&quot; the name of the textbox bound to that same record.</p>
  <p>When I click the button I get this error:</p>
  <blockquote>
  <p>&quot;Not enough parameters. 1 expected.&quot;</p>
  </blockquote>