title: (VBA) For loop and DLookup (MS ACCESS)
body: <p>I have a query named <strong>TimeQuery</strong>. I want MsgBox will show all <strong>[start_hour]</strong> values where <strong>[id]</strong>=1 then 2 etc. ...
  I have a problem. When i will use: </p>
  
  <pre><code>a = DLookup("Hour([start_hour])", "TimeQuery", "[id]=1")
  </code></pre>
  
  <p>it works good, but when use <strong>[id]=counter</strong> it doesn't show it. I have a MsgBox after that For Loop too and when <strong>[id]=counter</strong> it doesn't show that MsgBox too. What's wrong?</p>
  
  <pre><code>For counter = 1 To 3
  Dim a As Variant
  a = DLookup("Hour([start_hour])", "TimeQuery", "[id]=counter")
  MsgBox (counter)
  Next
  Debug.Print ("")
  </code></pre>