B
Bellyjeans
Hi all,
I have a situation that I'm sure is easy to fix, but I'm having a
moment and my brain won't work. I have a combo box. I have the
following code on the after update event of the combo box:
If Forms!frmStatus.cboStatusName = "Selection 1" Then
Me.txtBox1.Visible = True
Me.txtBox 2.Visible = False
Else
Me.txtBox1.Visible = False
Me.txtBox2.Visible = True
End If
If Forms!frmStatus.cboStatusName = "Selection 2" Then
Me.txtBox3.Visible = True
Me.txtBox4.Visible = True
Me.txtBox2.Visible = False
Else
Me.txtBox3.Visible = False
Me.txtBox4.Visible = False
Me.txtBox2.Visible = True
End If
If Forms!frmStatus.cboStatusName = "Selection 3" Then
Me.txtBox5.Visible = True
ElseIf Forms!frmStatus.StatusName = "Selection 4" Then
Me.txtBox5.Visible = True
Else
Me.txtBox5.Visible = False
End If
If Forms!frmStatus.cboStatusName = "Selection5" Then
Me.cboBox6.Visible = True
Else
Me.cboBox6.Visible = False
End If
Basically, in a nutshell, the coding makes a number of fields visible
or invisible, based on what is selected in the combo box
"cboStatusName". My problem is that if somebody changes the selection
in cboStatusName, the value in certain combo boxes remains there, even
if that field is made invisible. How do I make it so that if the
value in cboStatusName is changed, the fields that become invisible
also clear their values?
Thanks!
I have a situation that I'm sure is easy to fix, but I'm having a
moment and my brain won't work. I have a combo box. I have the
following code on the after update event of the combo box:
If Forms!frmStatus.cboStatusName = "Selection 1" Then
Me.txtBox1.Visible = True
Me.txtBox 2.Visible = False
Else
Me.txtBox1.Visible = False
Me.txtBox2.Visible = True
End If
If Forms!frmStatus.cboStatusName = "Selection 2" Then
Me.txtBox3.Visible = True
Me.txtBox4.Visible = True
Me.txtBox2.Visible = False
Else
Me.txtBox3.Visible = False
Me.txtBox4.Visible = False
Me.txtBox2.Visible = True
End If
If Forms!frmStatus.cboStatusName = "Selection 3" Then
Me.txtBox5.Visible = True
ElseIf Forms!frmStatus.StatusName = "Selection 4" Then
Me.txtBox5.Visible = True
Else
Me.txtBox5.Visible = False
End If
If Forms!frmStatus.cboStatusName = "Selection5" Then
Me.cboBox6.Visible = True
Else
Me.cboBox6.Visible = False
End If
Basically, in a nutshell, the coding makes a number of fields visible
or invisible, based on what is selected in the combo box
"cboStatusName". My problem is that if somebody changes the selection
in cboStatusName, the value in certain combo boxes remains there, even
if that field is made invisible. How do I make it so that if the
value in cboStatusName is changed, the fields that become invisible
also clear their values?
Thanks!