differences between access versions regarding isnull() function.

Hi Experts,

I have some users that recently upgraded their office version from 2003 to 2010, and the following code inspection stopped working.

If isnull(MyTextBox) then...

Open in new window

Any idea why?

Do I have to change it to one of the followings

if len(MyTextBox)=0
if me.MyTextBox.text = vbnullstring
if isempty(MyTextBox)
if me.MyTextBox & "" = ""

Open in new window

If yes, which option would be the best and still compatible with previous versions?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
There is no change in IsNull() behavior that I am aware of between these versions.
Something else is going on.
Does the VBA Code Compile ?
Are there any VBA Missing References /
Is the db in a Trusted Location ?
Is Macro Security set to LOW ?

bfuchsAuthor Commented:

Yes, it does compile and no missing references and just made sure to add it trusted location, however I am not sure how to set that macro option in 2010?

But in either case, that should only prompt some security messages, not change the code behaviour.

See attached (including immediate window).

Gustav BrockCIOCommented:
You may have to use:

    If Not IsNull(Me!ComboFacility.Value) Then


    If Nz(Me!ComboFacility.Value) <> "" Then


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
So the error is occurring on a different line than the IsNull() line above ?
bfuchsAuthor Commented:
The first option didn't work
In middle of testing the 2nd, will let you know.

Any idea why was it changed?
Do I need to change it in the entire App?

There is no error, the code inspection is just returning true for the following,
If not isnull(MyTextBox) then...

Open in new window

while nothing has been entered there, as its an unbound text & the form was just being opened.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Humm ... maybe be an Empty String ... and I wonder if Gustav means:

 If Nz(Me!ComboFacility.Value,"") <> "" Then
Gustav BrockCIOCommented:
Well, yes ... "" is for Nz the default value that will replace Null.

bfuchsAuthor Commented:
Hi Experts,

I am having a hard time testing it, as the more I dig into the more issues I'm encountered with..
like unbound check boxes not responding to click's, form taking forever to load data, some SQL related messages etc.

FYI- this is an Access 2000/3 ADP project that I am trying to make it work in 2010.

Do you know a place where I can find a list of all Access 2010  incompatibilities with previous versions?

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
There really are not that many incompatibilities ....
ADP ... I never worked with an ADP either.
Gustav BrockCIOCommented:
Neither have I.
I guess you just have to work through it bit by bit.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Have you done a Decompile on this db ?
bfuchsAuthor Commented:
Thanks Experts,
This solved a little, I guess will post again once I have a clear picture of whats still not working in the new environment.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.