Invisble when empty problem

  • Thread starter Thread starter Sue Compelling
  • Start date Start date
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
 
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)
 
Back
Top