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

hiding label and text control if the value is null

P: 2
Hello sir,
I want to hide the label and text box control which is of null value. The name of the FORM is "Index Entries". The Field name of that text box is the "Legislature".
For this I have taken the form in current event procedure and put the following visual basic code :
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form _ Current()
  2. Me.[Legislature] visible=Not IsNull(Me.[Legislature])
  3. End Sub
After running this code I have got the error 2165.

May 25 '07 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 14,534
Try this ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form _Current()
  3.    If IsNull(Me!Legislature) Then
  4.       Me!Legislature.Visible=False
  5.       Me!LabelName.Visible=False
  6.    Else
  7.       Me!Legislature.Visible=True
  8.       Me!LabelName.Visible=True
  9.    End If
  11. End Sub
May 26 '07 #2

Expert Mod 15k+
P: 31,770
Expand|Select|Wrap|Line Numbers
  1. Me.Legislature.Visible=(Not IsNull(Me.Legislature))
  2. Me.LabelName.Visible=(Not IsNull(Me.Legislature))
May 26 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.