Updating two tables at once

Results 1 to 2 of 2

Thread: Updating two tables at once

  1. #1
    Join Date
    Dec 1969

    Default Updating two tables at once

    Hello all...<BR><BR>I have two tables related to each other. One is tblQuestions, one is tblAnswers. They are set up so one question can have many answers. I would like to create a page where a user can type in a question and 4 answers to that question, each going to their respective tables. Since QuestionID is the FK in tblAnswers, and is not created until the record is made in tblQuestions, how do I accomplish this??<BR><BR>Thanks for any help!

  2. #2
    Join Date
    Dec 1969

    Default No...first one, then the other

    Create the record with the Primary Key first, then create the record in the other table using the first record&#039;s PK as its FK. If you need to know how to get the PK when the record is added, see that ASPFAQs. Search for "addnew".<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts