Won't the text boxes need to be set back to Visible (or not visible) in the
Current Event before testing Me.Area? In other words, if they are not
visible by default, and if the code for one record sets five text boxes to
visible, won't they remain visible unless explicitly rendered otherwise?
I was starting to experiment with this, and I believe Select Case would be a
more efficient approach. The real complication, though, is that setting the
text boxes to visible or not depending on the value in a text box could be
unwieldy if there are a lot of variations. If ten different values in the
text box mean ten different combinations of visible and invisible text boxes
elsewhere on the form, that's quite a few lines of code.
I have often read your good advice in this forum, and I don't want to
intrude on your reply now, but I was working on some thoughts when I noted
your reply, so I decided to respond in this way rather than heading off in
another direction.
Ofer Cohen said:
Try setting the visibility of the text boxes on the after update event of
the
combo
For example, set the text box to be visible only if the Area = "Value"
Me.[TextBox1Name].Visible = (Me.Area = "Value")
Me.[TextBox2Name].Visible = (Me.Area = "Value")
Me.[TextBox3Name].Visible = (Me.Area = "Value")
If you navigate between records, you'll need to set this code also on the
OnCurrent event of the form
--
Good Luck
BS"D
Olu Solaru said:
I have a form that contains one combo box and 25 text boxes.
1. The combo box autopopulates the boxes.
2. One particular text box is called Area, which pertains to a
particular
department.
3. The other 24 text boxes pertain to a training module.
What is I want to do is implement some VB code that will hide some of the
24
text boxes(during runtime) based on the value in the text box called
Area.
N.B. - Remember that the combo box auto-populates the text boxes.