Cannot insert record

G

Guest

Good morning to everyone:

I have several tables in a small database. I am new at this so please bear
with me.

The first table has a primary key WO wich is an autonumber. The second
table has a WO field which is a number and has another primary key. The
third table has a WO field and a different primary key. My problem is that
when I create a query with the first and second field I can add any records
as needed. However when I create a query with the first, second and third
table I am unable to insert any records!! The queary links the tables with
WO field.
Below is the SQL code for the query.

SELECT Test1.WO, Test1.name, Test1.last, Test3.ID, Test3.WO, Test3.Spec1,
Test3.Spec2, Test3.Spec3, Test3.Spec4, Test3.Spec5, Test1.address, Test3.ID
FROM (Test1 INNER JOIN Test3 ON Test1.WO = Test3.WO) INNER JOIN Test4 ON
Test3.WO = Test4.WO;


Does anybody know why this is happening?

Thanks

Celia
 
D

Duane Hookom

If you have a record in Test3 with a WO (primary key) of 9 and 3 related
records in Test1 and 2 related records in Test4 I believe your query would
return 6 records for WO 9. I can't imagine ever using a query with all three
tables. Which table would you expect to insert a record into?

Normally this type of relationship would be displayed in a main form based
on Test3 and two subforms based on Test1 and Test4. Everything should then
be updateable in the form and subforms.
 
G

Guest

Duane:
You just solved my problem. I was trying to enter information on all tables
hence one form that enters information on all three tables. However I was
trying to create a queary so that my form would use it and records be
inserted directly thorugh the form and into the query. Duh!! I was wrong in
what I was trying to do. (Tunnel vision there for a while) Thanks Duane.

Celia
 

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