Click to See Complete Forum and Search --> : Why 'Method or data member not found" ?


Bon La Lay
August 7th, 2001, 05:38 AM
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
\\-----------------------------------------//

Tower
August 7th, 2001, 10:13 PM
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