title: MS Access default value from another table
body: <p>I have two tables in a database. One is called salesreceipt and the other is salesreceiptlinedetail. </p>
  
  <p>Each row in salesreceiptlinedetail has a field IDKEY that matches a field TxnID in a row in salesreceipt. There can be multiple rows in salesreceiptlinedetail that can match the same row in salesreceipt.</p>
  
  <p>I have third party software that syncs my access database with Salesforce. The software only allows querying one table in the database at a time.</p>
  
  <p>I need to automatically copy some of the fields from the salesreceipt table to new fields in the salesreceiptlinedetail table so I can sync the data correctly.</p>
  
  <p>I'm very new to MS access. After trying many different things I landed on a solution that I think may work but I'm not sure how to do it. It looks like I can set the default value of a field. I'm thinking I need to do a DLookup to find the field I want to copy in the salesreceipt table and somehow use criteria to check the IDKEY matches the TxnID. I think I need to create a module with a function to do this but I'm not sure how and how to call it. </p>
  
  <p>I may be way off on this. I could use some help or ideas. I've been researching for hours and could use a little push in the right direction. Thanks in advance.</p>