+ Reply to Thread
Results 1 to 2 of 2

Me.Controls.Add returns "Compile error, method or data member not found"

  1. #1
    Registered User
    Join Date
    06-26-2007
    Posts
    6

    Me.Controls.Add returns "Compile error, method or data member not found"

    I have tried different methods of adding checkboxes, but everytime the code includes Me.*something*
    and everything i call it, i get "Compile error, method or data member not found.

    Example
    "Compile error, method or data member not found"

    Set chkBox = Me.Controls.Add("Forms.CheckBox.1", "chkCheck" & nNoOfCheckBoxes, True)

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Thats because ME refers to the object that the checkbox is in so if the code is in a worksheet module it refers to me.controls.....etc if you want to refer to it in another module or procedure you have to refer to it like Worksheet1.Controls....etc!

    Hope this helps.
    Not all forums are the same - seek and you shall find

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1