A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old March 14th, 2007, 03:30 PM posted to microsoft.public.access.forms
WhoCares
external usenet poster
 
Posts: 1
Default How to auto fill fields on subform from data on main form?

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.