R
Rick B
I have a data entry form where selecting a particular item from a combo box
will change a specific text box visible property to true. (By default they
are all hidden)
My question is that I have maybe 60 or 80 different text boxes each
representing a different field. I have named each of the text boxes the same
name as its corresponding field name with the exception of adding "txt_" in
front of it. I have applied the following code to the change property of the
combo box however there are tons of these IF statements. Is there a way one
could use variables to write this instead of having to write a ton of IF
statements? This would also help if the field names ever have to be
modified.
If cmbCategory = "Category1" Then
Forms!frmDataEntry![txt_Category1].Visible = True
Else
Forms!frmDataEntry![txt_Category1].Visible = False
End If
Thank you in advance,
-rick
will change a specific text box visible property to true. (By default they
are all hidden)
My question is that I have maybe 60 or 80 different text boxes each
representing a different field. I have named each of the text boxes the same
name as its corresponding field name with the exception of adding "txt_" in
front of it. I have applied the following code to the change property of the
combo box however there are tons of these IF statements. Is there a way one
could use variables to write this instead of having to write a ton of IF
statements? This would also help if the field names ever have to be
modified.
If cmbCategory = "Category1" Then
Forms!frmDataEntry![txt_Category1].Visible = True
Else
Forms!frmDataEntry![txt_Category1].Visible = False
End If
Thank you in advance,
-rick