|
-
August 7th, 2001, 05:38 AM
#1
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
\\-----------------------------------------//
-
August 7th, 2001, 10:13 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|