updating two tables from a form
Posted on 2005-05-03
I have got a database which includes the following two tables:
when i create a new record in tbl_job, i want to automatically create a record in the call table with the primary key of tbl_job (jobid) as a foreign key in the table tbl_call... i will also want to enter some other default data:
consultantID = <from the form>
jobID=<the primary key from the record written to tbl_job>
I was originally thinking of doing this with a trigger but then realised that it might not be possible since i need form data as well as the tbl_job primary key.
Is it possible to do this all in one go? if so how would i do it? is it best to do it in code or as a trigger? or should i create two pages, write the row to tbl_job first and then create the record for the call seperately (something i would prefer not to do)