Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form state just before and after Form.Init()
Message
From
25/12/2010 07:35:01
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
24/12/2010 10:43:58
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01493757
Message ID:
01493830
Views:
71
>>Basically, what you can't do in the Form.Init() is opening tables, if those are required for some of the form objects (through the objects' ControlSource or RecordSource). Since the objects instantiate before the form does, Form.Init() is too late, so you have to open the tables in Form.Load(), or in the form's DataEnvironment.
>
>If you set .bindcontrols=.f. at design time, this is no longer an issue, you can open your aliases in form.init(), and then set .bindcontrols=.t. and then they will bind.
>
>However, that's a one-time thing, i.e. the controls won't unbind if you set form.bindcontrols=.f. again, or if you add a control at runtime and try to give it delayed binding.

Oh, I didn't know about this one - thanks. Opening tables in Load() still seems simpler, though... But I guess there are problematic situations that can be solved by this delayed binding.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform