I'm writing some code to hide the text box if the value is null. I have twenty text boxes.
I'm using the code below, but I was wondering if there is cleaner way of doing this.
I'm using the code below, but I was wondering if there is cleaner way of doing this.
Code:
Private Sub Form_Current()
If IsNull(Me.Text0) Then
Me.Text0.Visible = False
Else
Me.Text0.Visible = True
End If
If IsNull(Me.Text1) Then
Me.Text1.Visible = False
Else
Me.Text1.Visible = True
End If
If IsNull(Me.Text2) Then
Me.Text2.Visible = False
Else
Me.Text2.Visible = True
End If
If IsNull(Me.Text3) Then
Me.Text3.Visible = False
Else
Me.Text3.Visible = True
End If
If IsNull(Me.Text4) Then
Me.Text4.Visible = False
Else
Me.Text4.Visible = True
End If