Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using views in forms
Message
From
20/12/1998 12:14:31
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164671
Message ID:
00169245
Views:
20
>>>>>Vinod,
>>>>>
>>>>>The view is missing the "parameterization" which is what makes it select a subset of the data. The article on my website talks about this, you might reread it. You don't use the JOIN tab to enter the parameter, you use the Filter tab instead. You select the table field that is the FK into the parent table, then =, then ?AVariableName. I also use ?ParentTable.PrimaryKey in some of my views instead of using a memvar, if I know the parent table will be open and on the record for the child records I want in the view.
>>>>>
>>>>>>>>Child view is returning me all the records which are matching but if i move the pointer in parent view, child view's pointer is still there on the old record..
>>>>>>
>>>>>>Pls help me on this.. I'm still not able to get the desired result and using filter as a temporary solution..
>>>>>>
>>>>>>Below is given sql command which view is generating... Pls advs. if anything is wrong in that..
>>>>>>
>>>>>>SELECT Imlc.*;
>>>>>> FROM im!banksview INNER JOIN im!imlc ;
>>>>>> ON Banksview.bnk_pk = Imlc.lc_bnkfk
>>>>>>
>>>>>>
>>>>
>>>>
>>>>I've changed the view as per ur article and now following sql is generated..
>>>>SELECT Imlc.*;
>>>> FROM im!banksview, im!imlc;
>>>> WHERE Imlc.lc_bnkfk = ?banksview.bnk_pk
>>>>
>>>>Imlc is a child table holds LC Info.
>>>>Banksview is a view from main table which is Imbanks holds bank names
>>>>Banksview.bnk_PrimaryKey is equal to Imlc.lc_bnk's Foregin Key.
>>>>
>>>>But the problem is same infact.. now I can see 2 records in my grid...For eg. If in the parent text box field it is showing me Bank NO. 1 and in grid it is showing me lc info for Bank no. 1 and 2.
>>>>
>>>>I know i've troubled you a lot on this matter.. But this is the first time, I've tried to use views.. sorry for inconvenience..
>>>
>>>Rather than performing a join, why not move the value you want to a variable and then make the select; something like:
>>>
>>>uFKVal = banksview.bnk_pk
>>>SELECT * FROM im!imlc WHERE lc_bnkfk = uFKVal
>>>
>>>You can create a view like this, taking a view parameter. Assuming you've created the view in your DBC called MyChildView, and the view parameter were called uFKVal, you'd do something like:
>>>
>>>uFKVal = banksview.bnk_pk
>>>USE MyChildView IN 0
>>>
>>>>
>>>>Pls give ur comments...
>>
>>If that is the only option, then I'll do it.. But I'll prefer not to use public variables, cos i'm not manually opening files, instead just adding in de of form..
>
>It doesn't have to be a 'public' variable; any variable that's in scope will work just fine. The variable needs to be in scope when the USE statement is issued; if it is not in scope when a REQUERY() is done, you'll need to declare it again. If no variable with the name of the parameter as defined in the view exists when you USE orREQUERY() a parameterized view, you'll get a messagebox prompting you to supply a value for the parameter.


Problem with this method are :-

1. Cannot use the built in DE...
2. On every skip/rec change I'll have to change the var. value and then requery..

If it can be simply done, how we are joining normal tables (where we just move the parent rec. and child table's rec. is also moved)..

pls advs. ur comments..
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform