Add Primary Key into two tables

Results 1 to 2 of 2

Thread: Add Primary Key into two tables

  1. #1
    Join Date
    Dec 1969

    Default Add Primary Key into two tables

    Hi everyone,<BR>I have hit a roadblock with my small project. It could be that I am just tired but I am really stumped on this.<BR><BR>I have a Access97 database with two tables inside. One called "Customers" the other "Orders". I have one asp page that will take the contents of the form and enter it into the "Customers" table and the same for the "Orders" table.<BR><BR>Now after the form is submitted for the "Customers" table, you are re-directed to the orders asp page, which will enter in an order "specific" to the customer you just added, then once submitted you can continue to add orders until you click a button to take you elsewhere.<BR><BR>Currently I am unable to grab the primary key value to have it transfer over to the orders asp page so that It can write in the foreign key value in the "Orders" table to create the relationship between the customer and the orders they have. <BR><BR>If anyone can help me out this would be great, I have no idea how to get this to work im still lookin!<BR>Thanks,<BR>-shaun

  2. #2
    Join Date
    Dec 1969

    Default try using a session variable...?

    session("PKey") = primary key<BR><BR>then access it in another page:<BR><BR>theID = session("PKey")<BR><BR>...<BR><BR>you can also pass it in a querystring or in a hidden form element if you want to do it the harder way...

Posting Permissions

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