Append up to 500 linked records

K

Karren Lorr

Hello

I have 2 tables

TableStudents
StudentID
1stName
Surname
Etc
Etc

TableOrders
OrderID
StudentID (this is the linking field)
Item
ItemCost
etc
etc


Sometimes a bulk order will be made for an item by anything up to 500
students. At the moment I am just opening each student’s form and filling in
the details. This can take up to 2 days.

For bulk orders all the details are always the same.
Eg
Item = Book ABC
ItemCost = 12.34

Is there a way in which I could just type these details just once and append
or add them to the Orders table so that each student has the same order (but
it will be a new OrderID for each person)

Thank you
 
D

Douglas J. Steele

Is OrderID an Autonumber, or are you assigning it a value?

If it's an Autonumber, you should be able to create a query that takes each
row from TableStudents and includes Item and ItemCost values. You can then
turn that query into an Append query.
 
K

KARL DEWEY

Yes, but it will depend on how your OrderID is created/formulated. If it is
an autonumber then it is very easy.
INSERT INTO TableOrders ( StudentID, Item, ItemCost )
SELECT TableStudents.StudentID, "Book ABC" AS [XX], 12.34 AS [YY]
FROM TableStudents;
 

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