Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid (Family, Person)
Message
De
31/10/1999 19:22:39
 
 
À
31/10/1999 19:07:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00284609
Message ID:
00284612
Vues:
11
>I guess I should have spelled out the previous Maximum Value better.
>
>I have a Pagefame with three pages
>
>Page one contains Family with uniqueID on FamilyID (Seq#)
>Page two contains People with uniqueID on PeopleID (Seq#) with a Foreign Key on Familyid
>Page three contains Address with uniqueID on AddressID (Seq#)
>
>When a new member is added to a Family (Baby borned) how can I get the maximum PeopleID (which is not necessarily in the Grid but in the table) into the Grid.
>
>For example:
>
>Table Family:
>
>Familyid: Name
>
>1 Aaron
>2 Smiths
>
>Peopleid: Name Familyid
>1 Joe Aaron 1
>2 Joe Smith 2
>3 Martha Aaron 1
>4 Leona Smith 2
>5 Jessica Smith 2
>
>Page one displays
>FID: Name:
>1 Aaron
>
>Page two displays
>FID: PID: Name:
>1 1 Joe Aaron
>1 1 Martha Aaron
>
>Martha just had baby David.. how do I get #6 for Peopleid into this Grid for Peopleid (Next Maximum Value for Peopleid in the People Table)

You can do it by using
Set order to id
GO BOTTOM
or by using CALCULATE MAX()
You can restore pointer afterwards to avoid unwanted grid scrolling, or you may even re-open the table in another work area and do all 'calculations' there. However, good way to generate surrogate IDs is to have separate tables with one record for each table:
TableName Counter
FAMILY       7
PEOPLE      26
ADDRESS    145
When application flow requires new ID, you go to this table, locate the record, lock it, increment counter by 1, unlock record and return new counter value.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform