Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActiveX controls and GetDataMember

Status
Not open for further replies.

weinem01

Programmer
Jun 25, 2001
13
0
0
US
I posted yesterday, quite vaguely, and have since done some work to narrow down the question. I have a parent and a child recordset in two separate forms. As I navigate through the parent recordset, I want the child recordset to automatically change.

I wrote an activeX control that I use to navigate a recordset. I have two separate controls - one on the parent form and one on the child form. I raise an event in the activex control called "DataChanged" that fires right after the record has changed. In the parent activex control, I reset the "RecordSource" property of the child activex control in the Datachanged event.

Everything works great when I first load the application. The child form contains the relevant recordset for the parent data. But, when I change the parent record, the child recordset does not change. When I step through the program, I realized that the UserControl_GetDataMember sub was not firing, and that it was this sub that sets the recordset for the child form. Is there anyway to force usercontrol_getdatamember sub to fire? I can't just call the subroutine because I need to pass the "Datamember" string and Data object to it, and I'm not sure what to use.

I've seen several postings raising a similar question on several newsgroups, but no answers. Any help would be greatly appreciated.

Thanks,

Matt Weiner
 
I do not understand very well ur prob.(I am from Costa Rica)
And there's few things that ur not telling me like the Database type, niether the connection type (ADO,RDO,DAO)
So I supposed u r using ADODB.recordset.

For parent changes try use ur recordset with the reserved word "withevents" maybe u know it has an even like BeforeChange and an AfterChange so it would let confirm changes.

When u change a recordset u have to set it again to the Datamember and Datasource of any control if u want to see the changes.

It is just a matter of set properties every time they r needed.

"I need to pass the "Datamember" string and Data object to it, and I'm not sure what to use. "

I don't understand what u mean by this. U use the Datamember when u have something in ur data enviroment or when u r using something called DataShape.
In any other case u just need to use the DataSource

I am sorry if the answer is not what u was specting but that's all I could understand is ur prob.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top