|
-
Jul 15th, 2004, 12:23 AM
#1
Thread Starter
Addicted Member
What's wrong with this? "a module is not a valid type" ERROR (RESOLVED)
I get an "a module is not a valid type" error when I try to compile this code. Can I not pass a label to a function?
VB Code:
Private Function SetLabel(CT As String, lbl As Label)
lbl.Tag = CT
End Function
Last edited by brandoom; Jul 15th, 2004 at 12:40 AM.
Brandon S Davids
-
Jul 15th, 2004, 12:25 AM
#2
Frenzied Member
Don't use Private Function, just use Function.
-
Jul 15th, 2004, 12:29 AM
#3
Thread Starter
Addicted Member
That doesn't work.
I've tried
Private Sub
Public Sub
Private Function
Public Function
Function
Sub
FYI, the procedure is in a forms code and I get the same error if I move the function to a module.
Any other ideas?
-
Jul 15th, 2004, 12:30 AM
#4
The picture isn't missing
Change lbl As Label to Byval lbl As Label
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jul 15th, 2004, 12:31 AM
#5
Thread Starter
Addicted Member
ByVal or ByRef don't matter, I still get that error.
I can put that function into it's own project and it works fine though.
-
Jul 15th, 2004, 12:40 AM
#6
Thread Starter
Addicted Member
If I change the "lbl as Label" to: "lbl as Control" it works fine. I still can't figure out what is wrong with passing it as a Label.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|