Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using relation to display field in grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00683933
Message ID:
00683984
Vues:
34
Interesting issue. Grid works only with only one Table/Cursor. You can combine both table using SELECT-SQL and use the resultant cursor as a record source.

Second thing you can try is to include Function in the ControlSource of the column and return a value of Table2.Field1 from it.

e.g.

Thisform.Grid1.Column1.ControSource = "Thisform.GetTable2Data()"

- Create a method on the form, GetTable2Data()
In this method just say RETURN Table2.Field1.


>I have a grid with Grid1.RecordSource = "Table1" Then I have each Grid1.Column1.Text1 = Table1.field1 and Grid1.Column2.Text1 = Table1.field2 and so on...but I want a column's text to display fieldn from a related table. That is, right before loading the grid I setup the two tables with a relations command: SELECT Table1 SET RELATION TO fieldn INTO Table2 ADDITIVE
>This relation works great for my report, just not in the form. My ControlSource for the Grid1.Columnn.Text1 for this related table just has "table2.fieldname".
>
>References in a report will pull in the related table but not on the form for some reason.
>
>Is that clearer?
>
>Doug
- Jayesh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform