Append Query problems

silversurfer19

Registered User.
Local time
Today, 14:44
Joined
Aug 20, 2008
Messages
26
Ok, this is my first ever database and though I've had some help with it theres another problem just popped up, which I'll attempt to explain as best I can. I have seperate order details, design, product and delivery details, which are all related. The primary key in the order table is the order ID, an autonumber field, so it's generated whenever something gets added to the table and is then used to reference delivery details etc. I'm working on a sort of summer work experience project (am a student) for a company and they want me to get this up and running for them but in parallel with their current system, so they can use both while they get the bugs in the Access one sorted out.
The problem is, the ideal way to do this would be to link an excel spreadsheet which is created weekly and contains details of orders, delivery, designs and products into Access. I've managed to do this but have hit a wall when it comes to appending the data linked from exce; into the existing Access tables. Is it possible for an Append query to append to more than one table at a time? and if so will it still relate the records when the order ID hasn't been generated yet? If this is possible, or theres any other way of going about it, help would be greatly appreciated.
 
I've attached a sample that may get you going in the right direction.

There are 3 tables:
ImportData would be the data you'd bring in from Excel.
OrderHdr and OrderDtl are 2 tables you would want to append too.

There are also 2 queries.
You'd run AppdHdr first. This pulls unique orders from ImportData.
Note that I set the Unique Values property for the query to Yes. This keeps the query from appending duplicate data into the table.
AppdDetail then links the Hdr table back to the ImportData table, so that you can get the OrderID and the other info for Dtl.
 

Attachments

Thank you very much for the reply, I've had a look at the sample you attached and I think I understand, so I shall go and see if I can make it work, and if there any more problems shall post again.
Thanks again.
 

Users who are viewing this thread

Back
Top Bottom