And Or Syntax

Novice1

Registered User.
Local time
Today, 00:00
Joined
Mar 9, 2004
Messages
385
The following If Then statement doesn't work. Am I using the And's and Or's correctly?


If (Me.CurrentSGLIAmt <> "400,000" Or Me.RSN_Increase_Amt <> "9") And Me.UBLCombo = "Married" Then

Me.SpouseLetter = -1

Else

Me.SpouseLetter = 0

End If
 
Well, when you use <> rather than =, the logic flips. Everything is either not equal to x or not equal to y. In other words, you want And in there rather than Or.
 
The following If Then statement doesn't work

There's a difference between working and producing unexpected results. If pbadly's advice didn't help, I suggest you provide us with examples--tell us what the 3 values are then tell us what you expect as a result of that code.
 

Users who are viewing this thread

Back
Top Bottom