I have a general form to gather range criteria for reports and updates.
Sometimes I want to open a file exclusive (for update purposes). I thought
maybe I could pass a tlexclusive parameter to determine the exclusiveness. I
have controls that are linked to tables (if these control's init event fires
before the table is open, an error is generated). Here's my question, if
parameters can only be passed to the form's init event, and the controls are
initialized before the form; is there a way, based on a parameter to open
tables in the dataenvironment exclusively or non-exclusively and before the
controls init events get fired. I have ways to work around this, but any
ideas could lead to a better solution.

Thanks in advance,

Re: Form and exclusive open by Josh

Josh
Mon Nov 28 18:00:01 CST 2005

do the "linking" in the form's init() method.



On Mon, 28 Nov 2005 15:16:16 -0800, "Ed James"
<EdJames@discussions.microsoft.com> wrote:

>I have a general form to gather range criteria for reports and updates.
>Sometimes I want to open a file exclusive (for update purposes). I thought
>maybe I could pass a tlexclusive parameter to determine the exclusiveness. I
>have controls that are linked to tables (if these control's init event fires
>before the table is open, an error is generated). Here's my question, if
>parameters can only be passed to the form's init event, and the controls are
>initialized before the form; is there a way, based on a parameter to open
>tables in the dataenvironment exclusively or non-exclusively and before the
>controls init events get fired. I have ways to work around this, but any
>ideas could lead to a better solution.
>
>Thanks in advance,


--- AntiSpam/harvest ---
Remove X's to send email to me.

Re: Form and exclusive open by Eugene

Eugene
Mon Nov 28 18:08:02 CST 2005

Ed James wrote:
> I have a general form to gather range criteria for reports and updates.
> Sometimes I want to open a file exclusive (for update purposes). I thought
> maybe I could pass a tlexclusive parameter to determine the exclusiveness. I
> have controls that are linked to tables (if these control's init event fires
> before the table is open, an error is generated). Here's my question, if
> parameters can only be passed to the form's init event, and the controls are
> initialized before the form; is there a way, based on a parameter to open
> tables in the dataenvironment exclusively or non-exclusively and before the
> controls init events get fired. I have ways to work around this, but any
> ideas could lead to a better solution.
>
> Thanks in advance,


In the form designer set the DataEnvironment.AutoOpenTables to .f.
In the Form.Init() this should do the trick.




LPARAMETERS tlExclusive

LOCAL loCursor as Cursor
FOR EACH loCursor IN this.DataEnvironment.Objects
loCursor.Exclusive = tlExclusive
NEXT loCursor

this.DataEnvironment.OpenTables()

Re: Form and exclusive open by Carsten

Carsten
Tue Nov 29 05:37:06 CST 2005

Ed,

next to the other good answers, here is another idea. Have you looked at the
property "Bindcontrols"?
Setting it to .F., it prevents VFP to bind the tables with the controls till
you sets it to .T.
At the end of init (or the maintaining-job) say:
THISFORM.BindControls=.T.
(admitted - the idea is untested)

--
Cheers
Carsten
_______________________________

"Ed James" <EdJames@discussions.microsoft.com> schrieb im Newsbeitrag
news:1658DF1D-8A7F-4678-BDEC-2373C3ABF826@microsoft.com...
>I have a general form to gather range criteria for reports and updates.
> Sometimes I want to open a file exclusive (for update purposes). I thought
> maybe I could pass a tlexclusive parameter to determine the exclusiveness.
> I
> have controls that are linked to tables (if these control's init event
> fires
> before the table is open, an error is generated). Here's my question, if
> parameters can only be passed to the form's init event, and the controls
> are
> initialized before the form; is there a way, based on a parameter to open
> tables in the dataenvironment exclusively or non-exclusively and before
> the
> controls init events get fired. I have ways to work around this, but any
> ideas could lead to a better solution.
>
> Thanks in advance,



Re: Form and exclusive open by EdJames

EdJames
Tue Nov 29 08:37:15 CST 2005

Thanks for all the responses, I'll try the bindcontrols property and see the
interaction (delay) on the form. I wonder why Microsoft limits passing
parameters to forms in the init event as opposed to the load event also, so
many events/ methods fire before the init event in the form.

"Carsten Bonde" wrote:

> Ed,
>
> next to the other good answers, here is another idea. Have you looked at the
> property "Bindcontrols"?
> Setting it to .F., it prevents VFP to bind the tables with the controls till
> you sets it to .T.
> At the end of init (or the maintaining-job) say:
> THISFORM.BindControls=.T.
> (admitted - the idea is untested)
>
> --
> Cheers
> Carsten
> _______________________________
>
> "Ed James" <EdJames@discussions.microsoft.com> schrieb im Newsbeitrag
> news:1658DF1D-8A7F-4678-BDEC-2373C3ABF826@microsoft.com...
> >I have a general form to gather range criteria for reports and updates.
> > Sometimes I want to open a file exclusive (for update purposes). I thought
> > maybe I could pass a tlexclusive parameter to determine the exclusiveness.
> > I
> > have controls that are linked to tables (if these control's init event
> > fires
> > before the table is open, an error is generated). Here's my question, if
> > parameters can only be passed to the form's init event, and the controls
> > are
> > initialized before the form; is there a way, based on a parameter to open
> > tables in the dataenvironment exclusively or non-exclusively and before
> > the
> > controls init events get fired. I have ways to work around this, but any
> > ideas could lead to a better solution.
> >
> > Thanks in advance,
>
>
>

Re: Form and exclusive open by Dan

Dan
Tue Nov 29 11:30:07 CST 2005

The object does not "exist" until Init(). (No object does.) There's nothing
to receive a parameter until then.

Dan

Ed James wrote:
> Thanks for all the responses, I'll try the bindcontrols property and
> see the interaction (delay) on the form. I wonder why Microsoft
> limits passing parameters to forms in the init event as opposed to
> the load event also, so many events/ methods fire before the init
> event in the form.
>
> "Carsten Bonde" wrote: