Setting a parameterized view in form's Init 
Author Message
 Setting a parameterized view in form's Init

I want to set the parameter of a parameterized view at the end of a
form's Init (until then, I don't know the value that needs to be set).

On my first attempt, with the view in the DE, the prompt appears for
the user to set the parameter as the view is opened before the
parameter is known.

On my second attempt, I removed the view from the DE and opened it
manually at the end of the Form's Init. However, as the view is also
involved as the child in a relation (which I had successfully set up
in the DE), on trying to do this manually, it failed as there are no
indexes on views, so I couldn't do a SET ORDER TO.

Question 1: Is there a way to stop the system asking the user for the
parameter value at the early stage, and just requery after I've got
the value?

Question 2: How does the DE set the relation without the index, and
how do I mimic this manually?

Many thanks
Ben



Mon, 27 Jan 2003 03:00:00 GMT  
 Setting a parameterized view in form's Init
Ben,

In the DE you have for the cursor the possibility to set the noDatOnLoad
property to .T. for the view...

HTH

Fred

Ben Hambidge a crit :

Quote:
> I want to set the parameter of a parameterized view at the end of a
> form's Init (until then, I don't know the value that needs to be set).

> On my first attempt, with the view in the DE, the prompt appears for
> the user to set the parameter as the view is opened before the
> parameter is known.

> On my second attempt, I removed the view from the DE and opened it
> manually at the end of the Form's Init. However, as the view is also
> involved as the child in a relation (which I had successfully set up
> in the DE), on trying to do this manually, it failed as there are no
> indexes on views, so I couldn't do a SET ORDER TO.

> Question 1: Is there a way to stop the system asking the user for the
> parameter value at the early stage, and just requery after I've got
> the value?

just initialize the parameter to a value.

Quote:

> Question 2: How does the DE set the relation without the index, and
> how do I mimic this manually?

> Many thanks
> Ben

--
FE AVP&Cie
La Rochelle, Europe


Mon, 27 Jan 2003 03:00:00 GMT  
 Setting a parameterized view in form's Init
To expand on Fred's correct advice...

To use parameterized views:

1) Put the view in the DE

2) Set its NoDataOnLoad property to .T.

3) In your form code, whenever you need to requery the view (and
   thereby populate it with data), prepare the view parameter
   variable(s), then issue the requery like so:

LOCAL vMyViewParam

  vMyViewParam = 'Some Parameter Value'
  REQUERY("myView")

4) If you need to index it, you can.  Just select the view
   and index it:

   SELECT myView
   INDEX ON some_col TAG some_tag

After that, you should be able to do a SET RELATION using it
on the child side.

-- TRW

Quote:

> Ben,

> In the DE you have for the cursor the possibility to set the noDatOnLoad
> property to .T. for the view...

> HTH

> Fred

> Ben Hambidge a crit :

> > I want to set the parameter of a parameterized view at the end of a
> > form's Init (until then, I don't know the value that needs to be set).

> > On my first attempt, with the view in the DE, the prompt appears for
> > the user to set the parameter as the view is opened before the
> > parameter is known.

> > On my second attempt, I removed the view from the DE and opened it
> > manually at the end of the Form's Init. However, as the view is also
> > involved as the child in a relation (which I had successfully set up
> > in the DE), on trying to do this manually, it failed as there are no
> > indexes on views, so I couldn't do a SET ORDER TO.

> > Question 1: Is there a way to stop the system asking the user for the
> > parameter value at the early stage, and just requery after I've got
> > the value?

> just initialize the parameter to a value.

> > Question 2: How does the DE set the relation without the index, and
> > how do I mimic this manually?

> > Many thanks
> > Ben

> --
> FE AVP&Cie
> La Rochelle, Europe

--
_______________________________________
My e-mail:  t r w 7

_______________________________________


Tue, 28 Jan 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. List boxes in VFP 6.0 - selected property won't set in form's init

2. Parameterized view over a "SET FILTER"

3. Parameterized VIEWS or SET FILTER TO ?

4. Local View parameterized filter doesn't work

5. Adding an object with a parameterized init using add object

6. One to Many forms /w Parameterized Views

7. Create view/set view not working from within form

8. 'Greyed' areas when viewing a form

9. Parameterized Views

10. Passing value(s) in parameterized views

11. Adding a record using Parameterized Views

12. Oracle parameterized view

 

 
Powered by phpBB® Forum Software