G
Guest
Hi folks,
I have the following code which works great in any form. I tried to create
the same code in a module which could be called by any form but in vain. I
got the error message “Compile error: invalid use of Me keywordâ€. Could
anyone show me how to fix the problem?
Thanks in advance.
Tim.
Sub x()
Dim ctl As Control
Dim strName As String
For Each ctl In Me.Controls
MsgBox ctl.Name
Next ctl
End Sub
I have the following code which works great in any form. I tried to create
the same code in a module which could be called by any form but in vain. I
got the error message “Compile error: invalid use of Me keywordâ€. Could
anyone show me how to fix the problem?
Thanks in advance.
Tim.
Sub x()
Dim ctl As Control
Dim strName As String
For Each ctl In Me.Controls
MsgBox ctl.Name
Next ctl
End Sub