How to auto fill fields on subform from data on main form?

W

WhoCares

To all,

I have a Main form with multiple tabs, the form is for employee
information, one of the tabs a has a subform where I'll record the
names of the employees children if he/she has any.

The subform will work if I make the datasheet use a lookup to the
employee table, but then I have to select the employee each time I
want to add a record in the children subform. I changed the children
table to not use the lookup to clerks on the employee name.

I had the subform working, (by working I mean, I manualy had to select
the employee from the lookup) but I had the subform select the
employee using a lookup to the Clerks table.

Since this is a subform, I'd like to have the EmployeeName in the
subform set automatically to the Clerks.Name field from the main
form. I've searched and read many articles but can't get it to work.

I read an article that mentioned that if I set the link master/child
to the corresponding fields, this would work. I have set the fields
Clerk.Name = Children.EmployeeName, but when I go into the subform,
the Children.EmployeeName is not set automatically with the contents
of the Clerk.Name field, actually it reads as "frmClerks" (this is the
name of the main form).

Some background info for you.

Employee table fields:

Clerks Table has:
Name as text, here is where I store the employee name
Children as Yes/No

Children Table has:
ChildId as AutoNumber
EmployeeName as text
ChildName
ChildBirthDate

I have a one to many relationship for these two tables, tied by the
Name - EmployeeName fields.


If I'm confusing, sorry, I know this is long, but I'm stuck.

TIA
Twice300
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top