Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append/Add Record in View - Blank key field in table
Message
From
23/07/1999 11:28:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Append/Add Record in View - Blank key field in table
Miscellaneous
Thread ID:
00245336
Message ID:
00245336
Views:
81
I have a one to multiple relationship displayed in a grid on the parent form. When the user wants to add (or edit) a new child record he presses a command button, calling a separate form using a local view (subPeople) of the child table containing only the children of the current record of the parent table. (filter for the local view : people.address_id = ?address.address_id)

The child form (People at Address) uses the same navigation toolbar as the parent form (Addresses). The child form uses the same form base class as the parent form.

When the users wants to add a child record (People) he picks the "Add" button from the nav toolbar. He fills in the form and saves it. The Save method of the form base class writes audit file information ( ie User DON added this record to Table People at time() and date()). It then hits a " = tableupdate(.t.) ". At this point the local view source table (People) is updated with all fields from the local view except for the key field (people_id). The key field (people_id) is correct in the local view but blank in the source table.

This of course causes an update conflict when the second new reord is added, because both have blank keys.

I made the key field updatable in the local view. This does not help. Local view has "Send SQL updates" checked, SQL where clause includes "SQL Key fields only" and Update using "SQL Update".

I feel this is just a small thing I have overlooked, but I cannot pin down what it is.
Best Regards
Don Simpson
Next
Reply
Map
View

Click here to load this message in the networking platform