Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Values from a temporary table to a Grid on a From
Message
De
21/05/2003 08:22:20
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00790976
Message ID:
00790998
Vues:
16
>I have a temporary table named crsmatch with 4 fields named:
>
>crsmatch.key1.......crsmatch.key4.
>
>crsmatch.key1 - Season
>crsmatch.key2 - Department
>crsmatch.key3 - Number
>crsmatch.type - Type
>
>The type can be of Sample or Technical
>
>I have 2 additional fields named countsamp and counttech ehich count the number of records that are either Sample or Technical. A typical results would be
>
>KEY1 KEY2 KEY3 KEY4 COUNTSAMP COUNTTECH
>AW2002 T59 JKT001 SAMPLE 1 0
>AW2002 T59 JKT001 TECHNICAL 0 1
>AW2003 T57 JKT002 SAMPLE 1 0
>AW2003 T57 JKT003 TECHNICAL 0 1
>
>And so on
>
>I have a combo field on my form listing the seasons. When I select the Season in the combo box I want to display the relevant records in a grid.
>For example if I chose AW2003 I would get:
>
>
>AW2003 T57 JKT002 SAMPLE 1 0
>AW2003 T57 JKT003 TECHNICAL 0 1
>
>In addition I would like to total the 2 count columns so it would say:
>
>Number of Samples - 1
>Number of Technicals - 1
>
>Can anybody put me in the right direction?
>
>Thankyou

Neil,
It sounds this is related with your previous questions. And to me it strongly sounds you're already moving off the track a lot. With sample data you work it might seem to work today. You didn't reply my previous question in other thread (XTab or PivotTable?) and seems you're doing a pivottable. Before you further move on I strongly suggest to rethink what you'd have on hand and what you'd want out of it.

OK thinking all were right up to this point set you grid.recordsource as an SQL and just refresh in combo.valid
ie:
.RecordSourcetype = 4
.Recordsource = 'select * from crsMatch where key1 = '+;
  'thisform.cmbSeason.Value'+;
  ' into cursor crsGrid'
For totals you could add an array property to form and SQL sum into that array. Set total showing textboxes' controlsources to array elements.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform