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
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
Don't use Private Function, just use Function.
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?
Change lbl As Label to Byval lbl As Label
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.
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.