Little back ground. I have a main form [Patient] and on that form is a [tabctl] and on a tab is the subform [implants]. what I have been trying to accomplish is to hide a set of controls that are tagged with the word femalegrp. I can get this to work on the main form.
Private Sub sex_Change()
Dim ctrl As control
If Me.sex = "male" Then
For Each ctrl In Me.Controls
If ctrl.Tag = "femaleGrp" Then
ctrl.Visible = False
End If
Next ctrl
ElseIf Me.sex = "female" Then
For Each ctrl In Me.Controls
If ctrl.Tag = "femaleGrp" Then
ctrl.Visible = True
End If
Next ctrl
End If
End Sub
But when I try and do this on the subform with
Private Sub Implants_Enter()
Dim ctrl As control
If Me.sex = "male" Then
For Each ctrl In [Implants].Form.Controls
If ctrl.Tag = "femalegrp" Then
ctrl.Visible = False
End If
Next ctrl
ElseIf Me.sex = "female" Then
For Each ctrl In [Implants].Form.Controls
If ctrl.Tag = "femalegrp" Then
ctrl.Visible = True
End If
Next ctrl
End If
End Sub
I get nothing. not even an error. Any guidance as to the error of my ways I would be grateful.
Private Sub sex_Change()
Dim ctrl As control
If Me.sex = "male" Then
For Each ctrl In Me.Controls
If ctrl.Tag = "femaleGrp" Then
ctrl.Visible = False
End If
Next ctrl
ElseIf Me.sex = "female" Then
For Each ctrl In Me.Controls
If ctrl.Tag = "femaleGrp" Then
ctrl.Visible = True
End If
Next ctrl
End If
End Sub
But when I try and do this on the subform with
Private Sub Implants_Enter()
Dim ctrl As control
If Me.sex = "male" Then
For Each ctrl In [Implants].Form.Controls
If ctrl.Tag = "femalegrp" Then
ctrl.Visible = False
End If
Next ctrl
ElseIf Me.sex = "female" Then
For Each ctrl In [Implants].Form.Controls
If ctrl.Tag = "femalegrp" Then
ctrl.Visible = True
End If
Next ctrl
End If
End Sub
I get nothing. not even an error. Any guidance as to the error of my ways I would be grateful.