Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 1st, 2012  |  syntax: None  |  size: 0.53 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Checking if record exists using DLookup (With Multiple Criteria)
  2. Private Sub MyCombo_BeforeUpdate(Cancel As Integer)
  3.  
  4. If Not IsNull(DLookup("RacerID", "Medals", "RaceID = " + EventCombo.Value _
  5. + " AND Medal = '" + MedalCombo.Value + "'" )) Then
  6. MsgBox "Record Exists"
  7. End If.
  8.  
  9. End Sub
  10.        
  11. Private Sub MyCombo_BeforeUpdate(Cancel As Integer)
  12.  
  13.     If Not IsNull(DLookup("RacerID", "Medals", "RaceID = " & Val(EventCombo.Columns(0)) & " AND Medal = '" & MedalCombo.Columns(0) & "'")) Then
  14.         MsgBox "Record Exists"
  15.     End If
  16.  
  17. End Sub