G
Guest
Hi
I am writing a function to 'import data' from tblAgent to tblMaster. Here is my logic
- read one tblAgent recor
- check if tblAgent.CustomerID exists in tblMaster.CustomerID (CustomerID is autoIncrement Primary Key )
* use rsMaster.FindFirst .....
- No, a NEW record, let's add this tblAgent record to tblMaster
* use rsMaster.addNew ...
* tblAgent.CustomerID will goto tblMaster.OriginalI
* this record will have a new CustomerI
* Get this new CustomerID
** use this new CustomerID to create a child record in tblProduct
- Yes (let's ignore for now
- read next tblAgent record til EO
- now, if all goes well, we will >> rsMaster.Update, rsProducts.Upat
- otherwise, we abort the operation and the tables remain unchanged
Question is after the rsMaster.addNew and assigning data into fields, how do I get the new CustomerID so I have this number I can use when I add records to tblProducts
Thank you for any help given
I am writing a function to 'import data' from tblAgent to tblMaster. Here is my logic
- read one tblAgent recor
- check if tblAgent.CustomerID exists in tblMaster.CustomerID (CustomerID is autoIncrement Primary Key )
* use rsMaster.FindFirst .....
- No, a NEW record, let's add this tblAgent record to tblMaster
* use rsMaster.addNew ...
* tblAgent.CustomerID will goto tblMaster.OriginalI
* this record will have a new CustomerI
* Get this new CustomerID
** use this new CustomerID to create a child record in tblProduct
- Yes (let's ignore for now
- read next tblAgent record til EO
- now, if all goes well, we will >> rsMaster.Update, rsProducts.Upat
- otherwise, we abort the operation and the tables remain unchanged
Question is after the rsMaster.addNew and assigning data into fields, how do I get the new CustomerID so I have this number I can use when I add records to tblProducts
Thank you for any help given