[Gambas-user] Reading control properties from a collection

Martin McGlensey mmcg29440 at ...3163...
Tue Apr 14 16:00:26 CEST 2015


Hello,

 

I have a form that contains a named datasource. I want to read the name and
table properties of that datasource from another form. Both forms are
visible.

I've used the loop "For each hWindow in Windows" to test to see if the form
is visible. If it is I cycle through the control collection for that form
till I find an Object.Type = "DataSource". So far so good - I can find the
datasource and assign it to a variant variable (DataTable). Now if I do strX
= DataTable.Name it returns "DataSource1"  instead of "Neighborhood" the
name of the datasource on the form containing the collection.

 

I want to get to the datasource name and table from the first form. They
should be name=neighborhood and table=tblneighborhood. If I assign
frmEntry.Neighborhood to datatable on the second form then I get the correct
data returned. I think it should be possible to get this data from the forms
collection but, I have not figured out how.

 

So can it be done and if so how?

 

Regards,

Marty




More information about the User mailing list