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?
LVL 5
bfuchsAsked:
Who is Participating?
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 ArchitectCommented:
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 ?

mx
0
bfuchsAuthor Commented:
@DatabaseMX,

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).

Thanks,
Ben
Untitled.png
0
Gustav BrockCIOCommented:
You may have to use:

    If Not IsNull(Me!ComboFacility.Value) Then

or:

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

/gustav
0

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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
So the error is occurring on a different line than the IsNull() line above ?
0
bfuchsAuthor Commented:
@Gustav,
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?

@Joe,
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.

Thanks,
Ben
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Humm ... maybe be an Empty String ... and I wonder if Gustav means:

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

/gustav
0
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?

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

/gustav
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Have you done a Decompile on this db ?
0
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.
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.