Pulling data from a form into a subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a user wants to create a new record in my I want to pull over the
Employees ID. My code doesn't generate an error, but it is not working. It
is:

Me!csmEMPID.Value = Me.Parent!empID.Value

Any thoughts?
 
Where is the code located? When do you run the code? Do you have a control
named empID on the main form?

Is empID the linking field between the parent and child tables? If yes, it's
easier to use the LinkMasterFields and LinkChildFields properties of the
subform control to do what you seek.
 
Is empID the key field in the table? Is there a one-to-many relationship
between csmEMPID in the table its being stored in and empID in its
table? If so, do you have referential integrity setup?
 
Back
Top