General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
How to insert data from one-to-many form?
I have a one to many form with a grid for child records. I use this to add records.
The key that links the tables has a primary index (machnum) on the parent and a regular index on the child. I get the next Machnum by..
select parent
set order to Machnum
go bottom
NewMachnum=Machnum+1
Insert into machine (Machnum) values (NewMachnum)
...in the init of the form. Right now I also am starting a transaction in the init. I don't like this because then I have an open
transaction till the form is exited. I need this however because I need the primary index so I can insert child records with
that same index into the child table. I also need the ability to back out of the transaction if a user decides to cancel the form.
What other method could I use so that I still have a new index but not an open transaction?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only