Ok. I've been wrestling with what seems like very simple VBA code and I'm still having problems with hiding controls in my form.
In my Form, I have a combo box "Diagnosis" with several row source selections (value list). One of the selections is "Other".
When "Other" is selected or checked, I want the next text box (called "Other Diagnosis") on the form to become visible.
I do not want the "Other Detail" text box visible on my form, unless "Other" is checked in the preceding combo box labeled "Diagnosis".
This is the code I've been using with no success: Thanks for your help.
Private Sub Diagnosis_AfterUpdate()
If Me.Diagnosis_combobox = "Other" Then
Me.[Other_Diagnosis].Visible = True
Else
Me.[Other_Diagnosis].Visible = False
End If
End Sub
Private Sub Diagnosis_comboboxcurrent()
If Me.Diagnosis_combobox = "Other" Then
Me.[Other_Diagnosis].Visible = True
Else
Me.[Other_Diagnosis].Visible = False
End If
End Sub
In my Form, I have a combo box "Diagnosis" with several row source selections (value list). One of the selections is "Other".
When "Other" is selected or checked, I want the next text box (called "Other Diagnosis") on the form to become visible.
I do not want the "Other Detail" text box visible on my form, unless "Other" is checked in the preceding combo box labeled "Diagnosis".
This is the code I've been using with no success: Thanks for your help.
Private Sub Diagnosis_AfterUpdate()
If Me.Diagnosis_combobox = "Other" Then
Me.[Other_Diagnosis].Visible = True
Else
Me.[Other_Diagnosis].Visible = False
End If
End Sub
Private Sub Diagnosis_comboboxcurrent()
If Me.Diagnosis_combobox = "Other" Then
Me.[Other_Diagnosis].Visible = True
Else
Me.[Other_Diagnosis].Visible = False
End If
End Sub