How to reference a third level tablecontrol?

Win10 LO7.1.2.2 HSQL2.51

Hi,

Still Trying to create a cascading listbox within a hierarchy of form form tablecontrol field.

How can I get the oform lines correct syntax?

> Sub S_FillRegion dim ssql(0) as string
> oform =
> Thiscomponent.drawpage.forms.Sone.Location.addresscontrol
> oListenfeld1 =
> oform.getByName("lstPais") s_selection
> = oListenfeld1.CurrentValue oListenfeld2 =
> oform.getByName("lstRegion")
> oListenfeld2.ListSourceType = 3'Sql
> ssql(0)= "SELECT
> ""rid"",""region"",""cid"" FROM
> ""tblRefRegion"" Where ""cid""
> ='"+s_selection+"'" oListenfeld2.ListSource=ssql'
> oListenfeld2.refresh End Sub

Thanks

Hello,

Sorry but your terminology is unknown. third level tablecontrol? Is this a control on a sub sub form?

And your code makes little sense in accessing things.

So oForm (this line can only make sense to you) is an access of the main form.

oListenfeld1 gets a control on the main form.

s_selection gets the value of oListenfeld1

oListenfeld2 gets another control on the main form

Not certain of what this line is:

oListenfeld2.ListSourceType = 3'Sql

Needs a lot more explanation. Where is this “third level”?

@Ratslinger

sorry for being unclear, post is related to Help with Cascading Listboxes in TableControl

form Sone links to form Location which has a table control named addresscontrol which contains a listbox for country and another for region.
upon selecting a country the regions then would be limted to the selected country.

Hello,

Only going by the image in the linked post.

Sone is the main form. Its’ sub form is MainFormContacts One of the sub forms under that is Location which contains the table control addresscontrol. So based upon the image:

oform = Thiscomponent.drawpage.forms.Sone.MainFormContacts.Location.addresscontrol

@Ratslinger
Thanks, almost there, had previously moved Location to the same level as Sone. Restored to original and the line works.
The location listbox now changes albeit in a strange way, selecting Mexico gives me regions in Bolivia and when I change the country to Bolivia I get Mexicos regions
Listbox property stores pk

Moreover the region is cleared from other existing records.

hmm, used incorrect event and forgot save and reload - working, thks for your help