I have a form (frmAppointment) with a subform on it
(frmAppointmentsub1). I have placed a command button on the main form
which calls the function below from the module. The purpose of this
function is to make fields beginning with YY invisble OnClick of the
command button on the main form. It works for the fields on the main
form but not on the subform. What do I need to add or do to make it
work on the subform? Any help would be most appreciated.
Thank You
TD
The command button on the main form event procedure is:
Private Sub cmdYY_Click()
Dim I As Integer
I = glrInvisbleFields(Me)
End Sub
The module function is:
Function glrInvisbleFields(F As Form)
Dim I As Integer
Dim C As Control
Dim X As Variant
For I = 0 To F.Count - 1
Set C = F(I)
If Left$(C.Name, 2) = "YY" Then
C.Visible = False
End If
Next I
End Function