Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using views in forms
Message
From
20/12/1998 07:28:11
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164671
Message ID:
00169222
Views:
25
>>>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..
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform