K
Kevin C Niven
I have a combo box and a text box on my form. If the combo box is not
set to some value (which I assume means it's null), I'd like the text
box to be invisible. As soon as the user sets the combo box, I'd like
the text box to appear.
I believe, perhaps wrongly, that I need to add some code to my form's
Current event. I also believe, perhaps wrongly, that the code needs
to take the following approximate form:
Private Sub Form_Current()
If Me.MyCbo.Value = "" Then
Me.MyTxt.Visible = False
Else
Me.MyTxt.Visible = True
End If
End Sub
But this does not work. Maybe the problem is in the test. I have
tried "If Me.MyCbo.Value = Null Then" and "If Me.MyCbo.Value Is Null
Then" which lead to runtime errors. I have also reversed the False
and True and tried just "If Me.MyCbo.Value Then".
Can someone help by telling me what code I need to add and where?
Many thanks,
Kevin
set to some value (which I assume means it's null), I'd like the text
box to be invisible. As soon as the user sets the combo box, I'd like
the text box to appear.
I believe, perhaps wrongly, that I need to add some code to my form's
Current event. I also believe, perhaps wrongly, that the code needs
to take the following approximate form:
Private Sub Form_Current()
If Me.MyCbo.Value = "" Then
Me.MyTxt.Visible = False
Else
Me.MyTxt.Visible = True
End If
End Sub
But this does not work. Maybe the problem is in the test. I have
tried "If Me.MyCbo.Value = Null Then" and "If Me.MyCbo.Value Is Null
Then" which lead to runtime errors. I have also reversed the False
and True and tried just "If Me.MyCbo.Value Then".
Can someone help by telling me what code I need to add and where?
Many thanks,
Kevin