By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,082 Members | 2,135 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,082 IT Pros & Developers. It's quick & easy.

Null expression???

P: n/a
I want to write an IF statment that will make a obj control box appear
only if there exists a picture for that record. Ie i want to know what
Null expression i can use to distinguish if the picture exists or not.
At the moment, this is the code i am using, but i am getting run time
error '424'....object required .....when i go to run it.

If Me![Picture3] Is Null Then
Me![Picture3].Visible = False
Else
Me![Picture3].Visible = True
End If
The first line of code is where the error is.
Can someone throw some light on my problem,
Thanks

Jul 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"MartinR" <ma*********@esbi.iewrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I want to write an IF statment that will make a obj control box appear
only if there exists a picture for that record. Ie i want to know what
Null expression i can use to distinguish if the picture exists or not.
At the moment, this is the code i am using, but i am getting run time
error '424'....object required .....when i go to run it.

If Me![Picture3] Is Null Then
Me![Picture3].Visible = False
Else
Me![Picture3].Visible = True
End If
The first line of code is where the error is.
Can someone throw some light on my problem,
Thanks
You're using SQL notation isnstead of VBA notiation. Try:

If IsNull(Me.Picture3) Then
Me.Picture3.Visible = False
Else
Me.Picture3.Visible = True
End If

Regards,
Keith.
www.keithwilby.com
Jul 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.