title: Microsoft Access run-time error '3075' Syntax Error
body: <p>I want to delete something in my database using a button with the following VBA behind it.</p>
  
  <p>Unfortunately it gives me a run-time error and I don't know why. I've looked how Access give the SQL statement back and in SQL Server it gives me no errors. </p>
  
  <p>VBA:</p>
  
  <pre><code>Private Sub btnDeleteTaak_Click()
        If Not IsNull(Me.lstTaakMonteur) Then
          If Not IsNull(Me.comboMonteur.Value) Then
              If Not IsNull(Me.comboOpdracht.Value) Then
                  Dim DeleteSQL As String
                  DeleteSQL = "DELETE OpdrachtTaak WHERE opdrachtnr = " &amp; Me.comboOpdracht.Value &amp; " AND taaknr = " &amp; Me.lstTaakMonteur.Value &amp; " AND monteurcode = '" &amp; Me.comboMonteur.Value &amp; "'"
                  DoCmd.RunSQL (DeleteSQL)
                  Me.lstTaakMonteur.Requery
              Else
                  MsgBox ("Er is geen opdracht geselecteerd")
              End If
          Else
               MsgBox ("Er is geen monteur geselecteerd")
          End If
      Else
          MsgBox ("Er is geen taak geselecteerd")
      End If
  End Sub
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>Syntax error (missing operator) in query expression 'OpdrachtTaak WHERE opdrachtnr = 1 AND taaknr = 6 AND monteurcode = 'LM1"
  </code></pre>
  
  <p>Table structure OpdrachtTaak:</p>
  
  <pre><code>opdrachtnr NUMERIC(5) &lt;pk,fk2&gt; NOT NULL
  taaknr NUMERIC(3) &lt;pk, fk3&gt; NOT NULL
  tijdsduur NUMERIC(4,1) NULL
  Monteurcode VARCHAR(3) &lt;fk1&gt; NULL
  </code></pre>
  
  <p>Would be great if you can help me out.</p>