Invisble when empty problem

S

Sue Compelling

Hi

I'm trying to make a text box and labels invisible when another field is
empty.

I've tried the following code on Form_Current though an error message comes
back with "Invalid use of Null"

Help ...

Me.OrgType.Visible = Me.OrgTitle = ""

TIA
 
A

AccessVandal via AccessMonster.com

Maybe try something else like

Me.OrgType.Visible = Len(Me.OrgTitle)
 
D

Dirk Goldgar

Sue Compelling said:
Hi

I'm trying to make a text box and labels invisible when another field is
empty.

I've tried the following code on Form_Current though an error message
comes
back with "Invalid use of Null"

Help ...

Me.OrgType.Visible = Me.OrgTitle = ""


If OrgTitle is "empty", it's likely that its value is Null, not the
zero-length string "". Try this:

Me.OrgType.Visible = Not IsNull(Me.OrgTitle)

That will hide OrgType when OrgTitle is Null. If you wanted to *show*
OrgType when OrgTitle is Null, you would take out the "Not":

Me.OrgType.Visible = IsNull(Me.OrgTitle)
 
A

AccessVandal via AccessMonster.com

Sorry, forgot about that. It should be this to avoid the nulls

Me.OrgType.Visible = Len(Me.OrgTitle & "")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top