I have the following code, but for some reason the "if" statement is not functioning properly. Instead of jumping to the "Else" statement, it simply acts as if the "IF" is not even there and continues through the code. Any ideas?
Code:
Dim AcctType
Dim varEstate
Dim varGift
varGift = "2"
varEstate = "1"
AcctType = txtAcctType.Value
If AcctType = varEstate Or varGift Then
Dim strScreenName
strScreenName = cmbROReports
DoCmd.OpenReport strScreenName, acPreview
'Exit_cmbROReports_Click:
' Exit Sub
'Err_cmbROReports_Click:
' MsgBox Err.Description
' Resume Exit_cmbROReports_Click
Else
MsgBox "You have selected Estate Gift Report. However, account type does not match.", vbOKOnly
DoCmd.CancelEvent
Exit Sub
End If