Copy Primary Key from subform to subform (1 Viewer)

DavRob

New member
Local time
Today, 23:57
Joined
Oct 19, 2019
Messages
27
I have a main form "frmContactsNew" which has 2 subforms "frmCustomersSub" and "frmContactsNewSub"

"frmContactsNewCustSub" is the results of a search using the search as you type method

"frmContactsNewSub" has a record source of tblContacts

The objective is to search for a customer then add a new contact to that customer.

My problem is the PK, I can't get the "CustomersID" of the customers table to populate in the CustomersID field of "frmContactsNewSub"

I have tried multiple methods with no success
Such as =[Forms]![frmContactsNew]![frmContactsNewCustSub].[Form]![CustomersID]

Any advice is greatly appreciated

DavRob
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:27
Joined
May 7, 2009
Messages
19,246
i already showed you how to use Master/Child Link fields on the subform.
if you use this, the Primary Key of Parent form will automatically be
saved to the sub-form.
there is no need to add VBA or code.
 

DavRob

New member
Local time
Today, 23:57
Joined
Oct 19, 2019
Messages
27
you are correct I forgot to requery sorry
 

Users who are viewing this thread

Top Bottom