title: Access query does not work with CheckBox value true
body: <p>I've got a problem that's driving me nuts. I have a checkbox that when checked is supposed to update a table with it's record. The query uses the ID number and Closed = true to filter the data.</p>
  
  <p>The query I'm using works fine in the query builder. And if I just add a number to the IDNum field it works fine, but when I use the IDNum form field the query fails. I've made sure I'm calling the IDNum field correctly since it's a number. Nothing I do makes it work.</p>
  
  <p>Thank you for your help.
  Maxine</p>
  
  <pre><code>Code
      Private Sub ckClosed_Click()
          Dim str_sql As String
          Dim intIDNum As Long
  
  
      intIDNum = Me.IDNum
  
  
      If Me.ckClosed.Value = -1 Then
          If DLookup("IDNum", "GCSNOTDEVTRACK_LAST", "IDNum = " &amp; Me.IDNum) Then
              Debug.Print "Value exist in table already"
              Exit Sub
          Else
          Debug.Print "Inside Click True Else"
          str_sql = "INSERT INTO GCSNOTDEVTRACK_LAST ( IDNum, [Control Number], [Publication Number], ClosedIssue, Status, CurrentState, Combined, IssueID, Priority, Mark ) " _
              &amp; "SELECT GCSNOTDEVTRACK.IDNum, GCSNOTDEVTRACK.ControlNo, GCSNOTDEVTRACK.[Publication No], GCSNOTDEVTRACK.ClosedIssue, GCSNOTDEVTRACK.Status, GCSNOTDEVTRACK.[Current State], GCSNOTDEVTRACK.Combined, GCSNOTDEVTRACK.[Issue ID], GCSNOTDEVTRACK.Priority, GCSNOTDEVTRACK.Match " _
              &amp; "FROM GCSNOTDEVTRACK WHERE (((GCSNOTDEVTRACK.IDNum)=" &amp; intIDNum &amp; ") AND ((GCSNOTDEVTRACK.ClosedIssue)=True));"
          DoCmd.RunSQL str_sql
         End If
      'Else
  
          '    End If
      End If
  End Sub
  </code></pre>