title: Trying to take the values from the primary key column of a table and enter it in the foreign key column of another table
body: <p>So I have four tables and they are linked by primary and foreign keys. I have a form that is used to enter information and I have set my primary keys column set to autofill in Access database. How can I take those values from the autofill column and enter it in the other table that I want. This is my Insert code..</p>
  
  <pre><code> sqlString = "INSERT INTO [Members] ([MemberName], [Child], [Adult], [PaymentMethod]) VALUES ('" + MemberName + "','" + Child + "','" + Adult + "','" + PaymentMethod + "')"
      cmd = New OleDbCommand(sqlString, myConn)
      cmd.ExecuteNonQuery()
  </code></pre>
  
  <p>That is what I use to input the info from my form and it works. Now there is another column that nothing is being entered in because it is the foreign key column and my primary key column in the other table is set to autofill with numbers. How can I fill my foreign key column to match my primary key column in the other table? I hope I explained this well, thanks for the help. </p>