Form and Subform

G

Guest

I have an access form and subform that are linked to different queries. They have a common field that links the child fields and master fields. Now the main table these queries come from was changed. Table1 needed to be replaced so I called it table1_old and replaced with table2 that I renamed table1. When trying to enter the data in the subform I get the following error: "You cannot add/change a record because a related record is rquired in table1_old
Why is it looking at table1_old. I checked all the queries and they have the right table name. Any sugestions
Thanks.
 
K

Kelvin

Check your relationships. You will need to remove this before you can make
changes. You'll probably also want to link your new Table1 correctly.

Kelvin

Niles said:
I have an access form and subform that are linked to different queries.
They have a common field that links the child fields and master fields. Now
the main table these queries come from was changed. Table1 needed to be
replaced so I called it table1_old and replaced with table2 that I renamed
table1. When trying to enter the data in the subform I get the following
error: "You cannot add/change a record because a related record is rquired
in table1_old"
Why is it looking at table1_old. I checked all the queries and they have
the right table name. Any sugestions?
 
G

Gary Miller

Kelvin,

Not quite sure why you felt that Table1 needed to be
replaced. It is more usual to modify or update a table than
actually replacing it. What has probably happened is that
Access transferred the existing relationship for the two
tables even though you renamed one. What you may need to do
now is to go to the Relationships window and delete all of
the relationships, close the window saving changes and then
reopen it and define the new relationships.

While you are at it, you may want to give serious
consideration to renaming your tables in a more descriptive
manner. Table1 is probably the name that Access gave it. You
can rename it to whatever you want. tblCustomers would be a
good name for a table that stores customer info. Do this
before you recreate the relationships.

--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
message
I have an access form and subform that are linked to
different queries. They have a common field that links the
child fields and master fields. Now the main table these
queries come from was changed. Table1 needed to be replaced
so I called it table1_old and replaced with table2 that I
renamed table1. When trying to enter the data in the subform
I get the following error: "You cannot add/change a record
because a related record is rquired in table1_old"
Why is it looking at table1_old. I checked all the
queries and they have the right table name. Any sugestions?
 
J

John

The properties of the SubForm contain two values (I
believe on the data tab), LinkChild and LinkParent (not
positive on exact name). My guess would be that Access
automatically renamed the LinkParent value when you
changed the name of the table. Edit the LinkParent and I
would suspect will fix the problem.

-----Original Message-----
I have an access form and subform that are linked to
different queries. They have a common field that links
the child fields and master fields. Now the main table
these queries come from was changed. Table1 needed to be
replaced so I called it table1_old and replaced with
table2 that I renamed table1. When trying to enter the
data in the subform I get the following error: "You cannot
add/change a record because a related record is rquired in
table1_old"
Why is it looking at table1_old. I checked all the
queries and they have the right table name. Any
sugestions?
 
N

news.east.earthlink.net

Hi Niles,

Access changed your references.
Sounds like you still have a reference to that table. Try opening the
subform alone in design view. Check all the code behind it and the data
source property. Then do the same with the main form. Next check your linked
table properties ( if you have links), then check combo box references. If
you still cant find the reference, work around it. Back-up your database.
Start with the table table1 and export it to another mdb, then take
table1_old and rename it back to table1. now delete table1 and import the
"real" table1 from the other mdb. It should solve your problem.
Niles said:
I have an access form and subform that are linked to different queries.
They have a common field that links the child fields and master fields. Now
the main table these queries come from was changed. Table1 needed to be
replaced so I called it table1_old and replaced with table2 that I renamed
table1. When trying to enter the data in the subform I get the following
error: "You cannot add/change a record because a related record is rquired
in table1_old"
Why is it looking at table1_old. I checked all the queries and they have
the right table name. Any sugestions?
 

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