title: Check to see if combobox values matches more than two times
body: <p>I am trying to fire an event if a specific combobox value appears more than 3 times ("md") in my control set. At the moment however, I keep getting high values like 32 or 40 despite there only being 8 comboboxes on my Access form. What am I doing wrong?</p>
  
  <pre><code>Dim mdCount As Integer
  For Each ctl In Me.Controls
      If ctl.ControlType = acComboBox Then
          Set cmb = ctl
          If (currentDropDown.Value = cmb.Value) And (Not currentDropDown Is cmb) And (Not currentDropDown.Value = "md") Then
              MsgBox "You cannot select the same value twice."
          End If
          If (currentDropDown.Value = "md") Then
              mdCount = mdCount + 1
          End If
      End If
  Next ctl
  Set ctl = Nothing
  
  Private Sub Submit_Click()
  'MsgBox mdCount
  If (mdCount &gt; 2) Then 
      MsgBox "Error!"
      Exit Sub
  End Sub
  </code></pre>