CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2000
    Posts
    66

    Why 'Method or data member not found" ?

    I made a control which support Data Bounding. Just the same as a TextBox ( I only add some extra
    functions in the control ). Call it TextBoxEx. And when I use it, I can assign DataSource to it
    from the property window in VB IDE. But if I try to assign DataSource in the code, I will get the
    "Method or data member not found" error.

    I call it in my code like this : Set TextBoxEx1.DataSource = m_rst ' here m_rst is a recordset

    The compiler will yell to me the error.:-(

    Why I can see the property but cannot access it in the code?

    Thanks in advance.

    //-----------------------------------------\\
    Where there's a wire , there's a way
    \\-----------------------------------------//

  2. #2
    Join Date
    May 2001
    Location
    Russia
    Posts
    200

    Re: Why 'Method or data member not found" ?

    You need write properties in usercontrol


    public property get DataSource() as Object
    DataSource = Text1.DataSource
    End property

    public property let DataSource(byval Source as Object)
    set Text1.DataSource = Source
    End property




    After this code Set TextBoxEx1.DataSource = m_rst working correctly

    Andy Tower

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

Featured