Open a form passing Primary key

WatsonDyar

Registered User.
Local time
Today, 00:48
Joined
Aug 12, 2014
Messages
50
I have a Form 01 that has staff names and the primary key StaffID. From this form, I want to open Form 02 to add a new record linked by the StaffID.

How do I automatically populate the PK (StaffID) in Form 01 as the FK (StaffID) in Form 02?
 
You can use OpenArgs if there will be multiple records added, or simply:

DoCmd.OpenForm "SecondFormName"
Forms!SecondFormName.StaffID = Me.StaffID
 

Users who are viewing this thread

Back
Top Bottom