Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Boolean IsNull Syntax Issue

Posted on 2012-03-26
Medium Priority
353 Views
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
Question by:creativefusion
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 29

Accepted Solution

IrogSinta earned 1000 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

DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 1000 total points
ID: 37769812

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

mx
0

LVL 17

Expert Comment

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

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

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
###### Suggested Courses
Course of the Month11 days, 1 hour left to enroll