title: MS Access VBA Dlookup on Yes/No field
body: <p>I can't for the life of me work out what is wrong with this, but I'm not an Access/VBA developer normally..</p>
  
  <p>I have a database table with about 20 fields, one of which is a Yes/No field. I want to extract the Yes/No value using DLookup, however am receiving the following error:</p>
  
  <pre><code>Run-time error '3075':
  Syntax error (missing operator) in query expression 'Enabled'.
  </code></pre>
  
  <p>The code I am using it:</p>
  
  <pre><code>MsgBox (DLookup("Enabled", "Numbers", "ID = " &amp; Me.cbxNumber.Value &amp; ""))
  </code></pre>
  
  <p>Enabled is a Yes/No field
  ID is a String field.</p>
  
  <p>The above DLookup works absolutely fine for returning String values for other fields, so the last parameter with the search query, and the table field, should be fine. It is simply complaining about the return field ('Enabled') thinking it is a query.</p>
  
  <p>The MsgBox element is also irrelevant, as I have tried assigning the result to an Integer and to a Boolean, and it's not complaining of a type mismatch which I would expect if this were the problematic part.</p>
  
  <p>Any thoughts?</p>