Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
One to many updatable form
Message
De
02/12/1997 03:44:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/11/1997 04:15:37
George Alexander
Qatar Armed Forces
Doha, Qatar
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00062681
Message ID:
00063217
Vues:
36
>Hi, To all
>
>I am in deep trouble since 2 weeks. Being new to VFP and afraid to trouble the valuable time of
>this forum members, I was trying and trying to get out of the jam to no use.
>
>The Problem is simple.
>
>I want to create a from with child records in the grid. All controls and the grid are read only in the
>beginning.
>
>When the user clicks add, I use memory variables to get the blank records and create a child table
>cursor with create cursor.
>
>so far good
>
>The trrouble is when I save the record, it saves the master record and it dont save the child records
>I have included the Begin trans roll back facility but it seems it is not working
>
>When the form gets refreshed after save, the complete structure of the grid gets changed.
>When in add mode I turn on the addnew and the deletion property and turn it off in normal mode.
>
>Is there a serious flaw in the whole structure. Can anybody get me out of this hot soup.
>
>Thanks to all (sorry for being so big in question)
>
>alex
Hi George,
I have a grid class that is outlined below :
-It has allowaddnew property set to .t. and tablebuffering on.
-It doesn't need a secondary cursor for buffering is on.
-In the when event of grid if the child has no records for the current key one is added via insert into.
-Tables used with this grid are always in a DBC and it's opened (if not) in the init event.
-In the init event table properties are retrieved and header, format, inputmask etc. props are set if not changed in grid manually. This lets grids be formatted using table props and saves time (I found it easier than building a builder and doing this many times).
-Table rec valid rule is used to allow adding new records. If a rec is not valid adding of a new rec is prevented via nodefault.
-When user presses save, if a record has incomplete data (does not obey record valid) or deleted it's reverted otherwise updated.
And if cancel is pressed all is tablereverted and if parent needs to be at least one child it's also reverted.
-Save and Cancel buttons are also subclasses of routine save-cancel and take care of rec validation, transaction, err messages etc.
-Setting of readonly, enabled etc for add and editmode are handled via custom classes and buttons.
I hope this helps.
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