Link Child and Master Fields - error

A

AlmaL

I've only been using Access for a week or two and have
come across a frustrating problem... The description
below is a simplified version of the tables and
form/subforms, but essentially demonstrate the problem.
Sorry for the long post!

I have 2 tables linked by a 1:many relationship and am
trying to create one form with a subform. The error
message is:

"The LinkMasterFields property setting has producted this
error: the object doesn't contain the Automation
object 'TblEmployee'.


Here is info on the 2 tables:

TblEmployee
- Primary Key is a field called EeID
- Other fields include - EeFirstName and EeLastName

TblContact
- No Primary Key
- Fields are - EeID, HPhone, and Pager

These 2 tables are linked by the EeID field:
TblEmployee / EeID - 1 to
TblContact / EeID - many
The join type is 2 -- include all records from
TblEmployee, and only those records from TblContact where
the join fields are equal.

In TblEmployee, the EeID field is an AutoNumber, long
integer. In TblContact, the EeID field Data Type
is "Number", long integer. The Lookup tab for EeID in
TblContact is set to:
- Combo Box
- Query/Table
- SELECT [TblEmployee].[EeID] FROM TblEmployee;

Here is info on the form / subform:

The form has 2 fields (EeFirstName and EeLastName) and
they work fine.

I have tried creating a subform using various methods
(wizard, dragging from database view and linking using
wizard or by typing in link child & master fields). When
I insert data in the subform in Form View, I get the error
message quoted above.

However, I can insert data by opening the table
TblEmployee and expanding the other table, TblContact.
This new data shows up on the form and subform!

I created a dummy database and went through all the steps
to see if the problem is in the first database (which
contains quite a few other tables) or form (which contains
tabs, etc) and sure enough the dummy database works!

The difference I notice between the dummy database and the
real one is that on the dummy database, the Link Child
Fields and Link Master Fields are exactly the same:
Link Child Fields - EeID
Link Master Fields - EeID
whereas in the real database, these 2 fields are different:
Link Child Fields - EeID
Link Master Fields - TblContact.EeID

If I manually type in the Link Master Fields - "EeID", I
get another error when opening the form: "Enter Parameter
Value, EeID".

What do I need to do to get the subform working?

Thank you for reading this post and I really appreciate
any help!
 
D

Dirk Goldgar

AlmaL said:
I've only been using Access for a week or two and have
come across a frustrating problem... The description
below is a simplified version of the tables and
form/subforms, but essentially demonstrate the problem.
Sorry for the long post!

I have 2 tables linked by a 1:many relationship and am
trying to create one form with a subform. The error
message is:

"The LinkMasterFields property setting has producted this
error: the object doesn't contain the Automation
object 'TblEmployee'.


Here is info on the 2 tables:

TblEmployee
- Primary Key is a field called EeID
- Other fields include - EeFirstName and EeLastName

TblContact
- No Primary Key
- Fields are - EeID, HPhone, and Pager

These 2 tables are linked by the EeID field:
TblEmployee / EeID - 1 to
TblContact / EeID - many
The join type is 2 -- include all records from
TblEmployee, and only those records from TblContact where
the join fields are equal.

In TblEmployee, the EeID field is an AutoNumber, long
integer. In TblContact, the EeID field Data Type
is "Number", long integer. The Lookup tab for EeID in
TblContact is set to:
- Combo Box
- Query/Table
- SELECT [TblEmployee].[EeID] FROM TblEmployee;

Here is info on the form / subform:

The form has 2 fields (EeFirstName and EeLastName) and
they work fine.

I have tried creating a subform using various methods
(wizard, dragging from database view and linking using
wizard or by typing in link child & master fields). When
I insert data in the subform in Form View, I get the error
message quoted above.

However, I can insert data by opening the table
TblEmployee and expanding the other table, TblContact.
This new data shows up on the form and subform!

I created a dummy database and went through all the steps
to see if the problem is in the first database (which
contains quite a few other tables) or form (which contains
tabs, etc) and sure enough the dummy database works!

The difference I notice between the dummy database and the
real one is that on the dummy database, the Link Child
Fields and Link Master Fields are exactly the same:
Link Child Fields - EeID
Link Master Fields - EeID
whereas in the real database, these 2 fields are different:
Link Child Fields - EeID
Link Master Fields - TblContact.EeID

If I manually type in the Link Master Fields - "EeID", I
get another error when opening the form: "Enter Parameter
Value, EeID".

What do I need to do to get the subform working?

Thank you for reading this post and I really appreciate
any help!

Let me commend you on a clear and detailed description of your problem
and your setup. I still have a couple of questions for you, though.

1. What is the RecordSource of the main form? Is it the table,
TblEmployee, or is it a query? If it's a query, what's the SQL?

2. Does the main form have a control on it (visible or not) that is
bound to the EeID field?
 
J

John Vinson

"The LinkMasterFields property setting has producted this
error: the object doesn't contain the Automation
object 'TblEmployee'.

The LMF should contain either the fieldname or the name of a control
containing the field - NOT the tablename. I suspect the problem is
that Eeid is a Lookup field, and therefore does not contain what it
appears to contain! Try changing it to Textbox instead of Combo box;
see if the values in the two tables are in fact what you think they
are.
 

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