Tables won't link correctly

  • Thread starter eatc7402 via AccessMonster.com
  • Start date
E

eatc7402 via AccessMonster.com

I am using Access 2002. I have two tables. The primary table has an
autonumber field which is set to increment. The field is a long integer.This
field is set as the primary key. The second subtable has
has a number field, set to long integer. Both the primary table
field, and the subtable field are named exactly the same.

Both table are shown on the Relationships screen and have a
one to many join line between them.

The primary table works correctly and autogenerates a new number in the link
field each time a new record is added.

However the link numbers are NOT being carried over to the
subtable. The subtables link field remain blank.

When I am displaying the Relationship window, and I select
Datebase Utilities/Linked Tanle Manager I get a message
the says "there are no linked tables in you database",
even though there are join lines between the table.

Well.. something is wrong, I've been trying to fix it for
several days, but I am afraid I'm lost in 'the forest or
the trees' syndrome.

I must be missing something, but I can't seem to figure it out.

eatc7402
 
T

tina

the Linked Tables Manager in Database Utilities refers to tables/data in
another file (database, text file, spreadsheet file, etc) that are "linked"
to your database. that has nothing to do with the relational links between
native tables in your database.
The primary table works correctly and autogenerates a new number in the link
field each time a new record is added.

However the link numbers are NOT being carried over to the
subtable. The subtables link field remain blank.

okay. how and when are you expecting the "link numbers" (foreign key values)
to be assigned to the subtable (child table)? it will not happen
automatically if you're entering data directly into the child table. it will
not happen at all when you enter records into the parent table - that has no
effect on the child table. the standard way to enter parent records and
related child records is to create a main form bound to the parent table,
and a subform (within the main form) bound to the child table. check the
LinkChildFields and LinkMasterFields properties in the subform control
(within the main form) to be sure they are set to the child table's foreign
key fieldname, and the parent table's primary key fieldname, respectively.
when you enter a parent record, and then move to the subform and enter a
child record, the foreign key field in the child record will automatically
populate with the primary key value from the parent record.

hth
 
E

eatc7402 via AccessMonster.com

I have a form created to enter data. A main form, connected to
the primary table, and a subform embedded in the main form.
The subform in connected to the subtable.

I've poked around but can't seem to locate the LinkChildFields and
LinkMasterFields you mentioned. It seems that thius may very
well pertain to my problem. Where do I find these fields to
check on??

eatc7402
 
G

Guest

Hi,

They are in the properties for your subform control (ie: the surrounding
control that houses your subform, located on your main form).

Hope this helps.

Damian.
 
E

eatc7402 via AccessMonster.com

Hi,

Found them now. Setting them appears to have only patialy worked.
Now the three hundred or so records I entered BEFORE this problem showed up
appear with all there link values showing correctly.

But now when I attempt to enter a NEW record I get a long error message like..

"The object does not contain the Automation object 'my_object'".

Hummmm. I don't understand this one at all. I did not create any
procedures or VBA stuff I am aware of if this is what the message refers to.

Where do I go from here.

This whole thing WAS working before I screwed something up, but I now lost
in the forest.

eatc7402
 
E

eatc7402 via AccessMonster.com

More info....

When I attempt to enter new data into the subform of the main form
that is when I receive this 'Automation 'error'. If I run the subform
standalone (NOT embedded into the main form) I do not receive the
'automation' error. If that helps any??

eatc7402
Hi,

Found them now. Setting them appears to have only patialy worked.
Now the three hundred or so records I entered BEFORE this problem showed up
appear with all there link values showing correctly.

But now when I attempt to enter a NEW record I get a long error message like..

"The object does not contain the Automation object 'my_object'".

Hummmm. I don't understand this one at all. I did not create any
procedures or VBA stuff I am aware of if this is what the message refers to.

Where do I go from here.

This whole thing WAS working before I screwed something up, but I now lost
in the forest.

eatc7402
[quoted text clipped - 4 lines]
 
E

eatc7402 via AccessMonster.com

Well, I started from scratch and made a whole new form, linking all three
tables, their keys and data.
The new form works fine and no errors. What was wrong with the old form? I
don't know.
I did something strange, and screwed it up.

Makes a good point for backups of working db's BEFORE you begin fooling with
a previously
working db and find yourself up the creek!

eatc7402
 
T

tina

sorry i didn't get back to you yesterday, eatc, but you did just fine on
your own - good job! and you're learned a fair bit about main/subforms,
which gives you a good boost up - subforms are very useful in Access user
interfaces, so it pays to know how to use them effectively.
 

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