Embedded forms - accessing procedures on parent forms
Posted
#1
(In Topic #978)
Trainee
bazzvn
Posted
Guru

Loose the Dim
By using Dim hChild you are making another new hChild variable local to Form_Open() not the public declaration so the
Public hChild As FChild never gets used so it remains to be Null , hence the error message..
try this…
My guess would be you already know all this but that little "Dim" slipped your attention
Posted
Trainee
bazzvn
Posted
Guru

bazzvn said
Thank you Bruce for such a simple solution. Sadly I did not know about this, which would have saved me lots of somewhat ugly workarounds in the past. I work mainly with sqlite databases, and the reason I like embedded subforms is that they enable me to encapsulate and localize code for viewing and manipulating specific tables and records in my databases, and I find that it helps a lot in tracking bugs.
bazzvn
Much of the gambas ide is written with forms embeded in other forms.
As are many of my programs.
It sure has some huge benefits, cleaner code, easier to track code/bugs
And yes Dim is specifically for defining variables within a Sub or Function that are local only to that function.
The variables can have the same name as global variables.
You're welcome
1 guest and 0 members have just viewed this.



