error passing object to procedure w/ VBA in Access 2000
Ok,
I am trying to pass a Control object to a sub but I get this error on the line of the function call
Error 438: "Object doesn't support property or method"
it fails on this line
Code:
DisableControl(cmdApply)
here's the function heading
Code:
sub DisableControl(ctl as Control)
...
End Sub
can anyone provide input as to why this doesn't work?
The error it gives has me to believe that VB can't find the method in the class but I'm not trying to add a class method. I'd just like to reference the object in the procedure. Thanks
Re: error passing object to procedure w/ VBA in Access 2000
Hi Tariqc, welcome to VBForums!
I'm not sure if this will eliminate the error, but your calling of the function is incorrect.
Instead of DisableControl(cmdApply), you should have one of these:
VB Code:
Call DisableControl(cmdApply)
DisableControl cmdApply
Re: error passing object to procedure w/ VBA in Access 2000
thanks a lot that solved my problem. :afrog: