There are two issues with this code line ...
If Combo99.Text = "SM" Or "TW" Or "LM" Or "LV" Or "SV" Then
The combo's
Text
property is available only when it has focus. When focus shifts to a different control, such as when the user clicks a command button, useCombo99.Value
instead.When you use
Or
between conditions, you must repeat the item from the left side of the=
sign again for eachOr
.
Consider these two If
statements ...
If strLetter = "a" Or "b" Then
If strLetter = "a" Or strLetter = "b" Then
The first throws an error, but the second does not.
If you prefer to compare something to a list of values, you can use Select Case
.
Select Case Me.Combo99.Value
Case "SM", "TW", "LM", "LV", "SV"
' insert code to send email
Case Else
' no email
End Select