Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 tables at mygrid
Message
From
23/08/2005 06:51:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
23/08/2005 06:06:07
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01042845
Message ID:
01042850
Views:
17
>hi all,
>would you help me,
>
>i want to get fields form 2 tables to mygrid as under
>table1 have course number,course name
>table 2 have g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>
>i need to see at mygrid1 course name from table1
>and g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>from table2
>
>and i need to save(append) at table2 COURSE NUMBER from table1
>and all records have g1,g2,wm1,g3,tot1,chr1,g4,g5,wm1,g6,tot2,ltot,chr2
>
>course name  g1   g2  wm1  g3  tot1  chr1 g4 g5 wm1 g6 tot2 ltot chr2
>  math       14.5 12  7    40   73.5  ..............................
>  since .............................................................
>   .
>   .
>   .
>   .
>   .
>
>
>thanks.
>m.qasem

Mohammed,
There is some typo in your message I think. A table cannot have 2 fields with the same name.
Tot in your sample seems to be sum of g1,g2,wm1,g3 fields and thus is redundant data (unless if it's something editable for adjustments).
Anyway you can do it selecting to a cursor or with relations. With relations after setting your relation:
-set skip to 2nd table if it's a one-to-many relation (or use 2 grids)
-add as many columns as you need to the grid.
-set controlsources to respective alias.fieldname and for calculated values like tot set it to:
(table2.g1+table2.g2+table2.wm1+table2.g3)
-set grid to readonly
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform