title: How to pass a Variable/Function into SQL Query?
body: <p>I am attempting to Insert a Row on a Table, but I cannot seem to pass the TASK_ID as a value/variable/function into the SQL Statement. Throughout the application, to acquire TASK_ID, I use:</p>
  
  <p><code>Dim taskID = ds.Tables("ReminderTable").Rows(Count).Field(Of Integer)("TASK_ID")</code></p>
  
  <p>Some helpful context-code :</p>
  
  <p><code>da.Fill(ds, "ReminderTable")</code></p>
  
  <p><code>Count = ds.Tables("ReminderTable").Rows.Count - 1</code></p>
  
  <p>Here is what I'm trying to do:</p>
  
  <p><code>da.InsertCommand = New OleDbCommand("INSERT INTO ACTIVITY (TASK_ID, ACTIVITY_CDE, ACTIVITY_NOTE) VALUES (3827, 1, 'Reminder Sent: ' &amp; Now)", Connection)</code></p>
  
  <p>I keep receiving the error </p>
  
  <blockquote>
    <p>No value given for one or more required parameters.</p>
  </blockquote>
  
  <p>when I replace <strong>3827</strong> with a variable/function/reference.</p>
  
  <p>The  statement works as-is, but I need to replace "<strong>3827</strong>" in the above statement with the TASK_ID, but it won't accept my variable, a function or the location that I use elsewhere throughout the project to reference the same thing.</p>
  
  <p>I'm working in Visual Studio 2019, using a Microsoft Access Database </p>