title: Access Display Message Box if Query Conditions Met
body: <p>Hi I'm trying to display a Message Box based on values from a query. I've tried the DLookUp function of the following: </p>
  
  <pre><code>If (DLookup("ID1", "qry_CheckID") = Forms!MainForm!ID2) Then
      MsgBox "Your ID is bad.", vbOKOnly, ""
  End If
  </code></pre>
  
  <p>Basically I want to see if ID1 from my query matches with ID2 in my form. However the DLookUp isn't working as (I had) intended. </p>