Search

G

Guest

John,
Is there an easy way to put all of the pet types in one row if they are
already in the database in multiple rows or do i have to enter them in from
scratch, there are already alot of records in the database, over 2000.

Thanks,
James
 
J

John Griffiths

Hi James

Use INSERT query based on the original table like this.
I'll rename <main-form to Customer as it is more specific and I'll assume
that a field called PetType with the same characteristics as in your main
table (missing from my little Pet table at the end of my last post.

*** warning this is air code and might need adjusting in query window ***
INSERT INTO Pet ( Owner, PetType )
SELECT CustomerID, PetType1
FROM Customer

INSERT INTO Pet ( Owner, PetType )
SELECT CustomerID, PetType2
FROM Customer

INSERT INTO Pet ( Owner, PetType )
SELECT CustomerID, PetType3
FROM Customer

If PetID is an autonumber you don't have to create new id numbers Access
will.
Look in help for INSERT and SELECT INTO queries for more info.

Any help - John
 

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