Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding New Records In A Grid
Message
De
02/07/1998 11:34:51
 
 
À
01/07/1998 22:07:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00113051
Message ID:
00113803
Vues:
24
>>Okay, I added the "NODEFAULT" and it seemed to work
>>to an extent, i.e. it added the correct parent_id number,
>>but it also added an incorrect otherparent_id! But this
>>is progress. I didn't quite understand what you meant
>>when you said "and then going to the record." Please
>>explain further. TIA --lincoln
>
>What seems to be happening is that you are inserting two records,
>one during the above code and one doing the grid's AllowAddNew
>event. Turn off the grid's AllowAddNew event since your program
>is personally handling the insert ( AllowAddNew=.f.).
>
>If the application is a single user application, all you do
>is have to issue a
>
>SELECT childalias
>GO BOTTOM
>this.parent.gridname.refresh && Your in the ADD button
>to get to the last record
>(your inserted record).
>
>If the child table has a primary key, substitute the
>GO BOTTOM with a LOCATE FOR childkey=m.hcildkeyIncrement.
>
>If the child table doesn't have a primary key, you've got
>code that's a little more messy. Every one of my tables
>always has a primary key (single fields only) to identify
>every record. It makes life wonderfully uneventful. [g]

Hi Gene,
I've switched my grid to a view, I'm not sure that should have made a difference but it has. My AddNew property is still "true," but it seems to work and doesn't create two records anymore. I'm still working on the wrong "otherparent_id" problem and will try to use your sugestions.
Thanks for the help.
--lincoln
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform