Romio_1968
Member
- Local time
- Today, 10:40
- Joined
- Jan 11, 2023
- Messages
- 126
I have the following module>
' Hide the controls with Tag "H"
Option Compare Database
Option Explicit
Public Sub HideTaggedH(frm As Form)
Dim ctl As Control
For Each ctl In frm.Controls
If TypeName(ctl) = "SubForm" Then
If ctl.Tag = "H" Then
ctl.Visible = False
End If
ElseIf ctl.Tag = "H" Then
ctl.Visible = False
End If
Next ctl
End Sub
I am calling it from inside Form_Load event, using
Call HideTagedH(Me)
The form options are>
Option Compare Database
Option Explicit
This pops a compile error. Expected variable or procedure, not module.
What am I doing wrong here?
' Hide the controls with Tag "H"
Option Compare Database
Option Explicit
Public Sub HideTaggedH(frm As Form)
Dim ctl As Control
For Each ctl In frm.Controls
If TypeName(ctl) = "SubForm" Then
If ctl.Tag = "H" Then
ctl.Visible = False
End If
ElseIf ctl.Tag = "H" Then
ctl.Visible = False
End If
Next ctl
End Sub
I am calling it from inside Form_Load event, using
Call HideTagedH(Me)
The form options are>
Option Compare Database
Option Explicit
This pops a compile error. Expected variable or procedure, not module.
What am I doing wrong here?