Solved

Boolean IsNull Syntax Issue

Posted on 2012-03-26
4
346 Views
Last Modified: 2012-03-26
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
0
Comment
Question by:creativefusion
4 Comments
 
LVL 29

Accepted Solution

by:
IrogSinta earned 250 total points
ID: 37769811
If I wanted to see if both CboFromState and CboToState have data I would use:

     ElseIf Not IsNull(Me.CboFromState) And Not IsNull(Me.CboToState) then
     'DATA FOUND IN BOTH FROM AND TO STATE
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
ID: 37769812
How about:

ElseIf Not IsNull((Me.CboFromState)  And Not IsNull((Me.CboToState)  Then

mx
0
 
LVL 17

Expert Comment

by:Kent Dyer
ID: 37769814
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
0
 

Author Closing Comment

by:creativefusion
ID: 37769835
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!!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now