Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using views in forms
Message
 
 
To
20/12/1998 07:04:16
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordan
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00164671
Message ID:
00169255
Views:
19
Vinod,

>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

First take out the im!banksview in the FROM. The only table you should see in the View designer should be your Imlc table. So the select should look like:

select Imlc.*;
from im!imlc ;
where Imlc.lc_bnkfk = ?banksview.bnk_pk

On the form where you are using this view, set the cursor's NoDataOnLoad property = .t.

In the form.Init()

requery( "TheView" )
this.Refresh()

And you should only see the records of imlc that are linked to the current record in banksview.

If this doesn't work perhaps you should post the select that's creating banksview. You might also look at the sample form from the website article and compare the non-default values between that form and yours. Maybe even just create a simple form that you build like this:

drag the banksview from the project manager into the DE
drag the imlcview onto the form creating a grid, set the NoDataOnLoad and the above init code and run it.

>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.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform