title: MS Access: How can I get a 'Data type mismatch' when I'm using variants?
body: <p>I'm trying to open a report from a form in vba:</p>
  
  <pre><code>Dim ALS_ID As Variant
  ALS_ID = Me.Controls("ALS_ID").Value
  DoCmd.OpenReport "BoxLblRpt", acViewPreview, , "[ALS_ID]= '" &amp; ALS_ID &amp; "'"
  </code></pre>
  
  <p>but I'm getting:</p>
  
  <pre><code>Run-time error '3464': Data type mismatch in criteria expression.
  </code></pre>
  
  <p>I'm using something of similar format that works without errors (PO_ID and Part are also both variants):</p>
  
  <pre><code>DoCmd.OpenReport "OutgoingBoxLblRpt", acNormal, , "[PO_ID]= '" &amp; PO_ID &amp; "' AND [PART] = '" &amp; PartCombo &amp; "'"
  </code></pre>
  
  <p>How can I get a type mismatch in the first OpenReport if I'm using a variant? </p>