title: Checking if record exists using DLookup (With Multiple Criteria)
body: <p>Im trying to create a function in my VBA where if the record they are trying to insert already exists however it returns a type mismatch.</p>
  
  <p>EventCombo is a integer
  MedalCombo is string </p>
  
  <pre><code>Private Sub MyCombo_BeforeUpdate(Cancel As Integer)
  
  If Not IsNull(DLookup("RacerID", "Medals", "RaceID = " + EventCombo.Value _
  + " AND Medal = '" + MedalCombo.Value + "'" )) Then
  MsgBox "Record Exists"
  End If.
  
  End Sub
  </code></pre>
  
  <p>What this does (or is supposed to do) is make sure no one else has the same medal in the same race.</p>
  
  <p>What am I doing wrong?</p>