Link to home
Start Free TrialLog in
Avatar of creativefusion
creativefusionFlag for Australia

asked on

Boolean IsNull Syntax Issue

All,

I am struggling with getting the following syntax to work and wondering if someone can help put it right.

My CboFromState = 1 and CboToState = 2 but each time I parse this code, it skips to the End If instead of doing what I want it to do if values are found in both CboFromState and CboToState.

ElseIf IsNull((Me.CboFromState) = False) And IsNull((Me.CboToState) = False) = True Then 'DATA FOUND IN BOTH FROM AND TO STATE

Any help much appreciated.
CF
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Instead of an IF..ELSE..END If..  Or IF..ELSEIF..  Why not use a CASE Statement instead?  It will force a true condition which would be ideal in this example.

HTH,

Kent
Avatar of creativefusion

ASKER

Guys, I hope you don't mind. To be fair I have split 50/50 because you both came up with the same answer only seconds between each other.

Thanks guys. Exactly what was needed. It was wrecking my brain!!