Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Expression in View Designer
Message
From
19/03/1999 11:35:57
 
 
To
19/03/1999 09:06:19
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00198971
Message ID:
00199778
Views:
11
>I apologize for asking so many questions about this one topic, but if I don't ask questions, my chances of completing this form successfully are slim!


Don't apologize- that's what the UT is for.

>want to make sure. After I completed the SQL statement and "browsed" the view, a form popped up that asked me for a parameter, and didn't show me the records in my orders detail table as it had before.

The form popping up is normal, it is what happens if you don't define your parameter before you REQUERY() the view.

>So, I went in and changed the SQL statement for my view to:
>WHERE ordersdetail.norderid = ?orders.norderid

This can work, but I don't recommend it. I like to set the view parameter to a variable, instead of directly setting it to the field, because setting it to the parent field requires tat you have the parent table open wherever you use the view. In this particular case that's ok, because that table is already open in you form, but it might not be the case down the road in the next form or report that you want to use the view in.




>My question is> Is ?orders.norderid what you were referring to in your lnParentID?

See above. Ues a variable instead of the table.field directly.


>That was the part I was a little confused. The reason being, later in your post, you stated that wherever there are changes in the parent record, to issue the following changes:

>lnParentID = ParentTable.pk
>REQUERY(extended_price_detail)
>THISFORM.extended_price_detail.Refresh()
>
>
>If this is the case, lnParentID = ParentTable.pk would be:
>
>orders.nordeid = orders.norderid
>

No, No. Every time you requery a parameterized view, it creates (internally) an SQL statement with the value of your variable at the time. If you have not defined hte variable, or you have defined it as a field, you will get the little dialog you mentioned before. If you change your view to use a variable this will all work itself out.


>I noticed it threw in that ?m.

The "m." is nonmaterial here. It is just notation that lets the programmer know that the variable is a variable and not a field.

>I was just wondering if that is what you meant with ?lnParentID, that I needed to throw in a variable?


Yup.

>Do I have things set up correctly, or am I missing the boat?

Gettin there.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform