Results 1 to 3 of 3

Thread: error passing object to procedure w/ VBA in Access 2000

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    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

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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:
    1. Call DisableControl(cmdApply)
    2. DisableControl cmdApply

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2005
    Posts
    2

    Re: error passing object to procedure w/ VBA in Access 2000

    thanks a lot that solved my problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width