-
December 6th, 2002, 06:21 AM
#1
Passing a textbox as a function parameter
I have a function that accepts a textbox as a parameter
eg.
Sub LogSetup(tb as textbox)
'Code
End sub
My problem is that when I attempt to run the code, I get a type mismatch error, because VB6 thinks I am passing the default method tb.text through.
Is there a method of disabling the default method in VB6 so that I can pass the object? Or is there a method of passing a reference to the object as the parameter like in VBA.
-
December 6th, 2002, 06:35 AM
#2
He,
try Sub LogSetup(byref tb as textbox)..
and if that does not work :
Sub LogSetup(byref tb as Object)
dim cCast as textbox
set cCast = tb
end sub
Code works in VB 5...
hope it help,
Jewe
A VB programmer trying to stay alive in a Real C World
If the hardware is so great.. why use software to correct it..?? It will only slow it down..
Al is de hardware nog zo snel de software achterhaalt het wel
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
|