Freakin' Access. I hate that it encourages people to name their tables with 'tbl' as a prefix. IMO it adds no useful information whatsoever, especially when the database is ported to a real relational database management system like SQL Server. ;)
Anyway, your tblOrder_Header appears to be correctly defined, with the OrderID as a primary key. A Primary key is always implemented via an index and you can't change that. You
can decide whether that index is clustered or not, but that's another subject.
Quote:
quote:
Table 2: tblOrder_Detail has OrderID also has it as a key field and is indexed.
|
This statement I don't understand.
The OrderID cannot be a primary key here, unless every order only has 1 detail line. Your detail table should have the OrderID column as a foreign key into the Order_Header table, and something else as its primary key, like the combination of OrderID and a line number. Many people would define a DetailID column as a primary key to the Details table. This column would be an Identity column, which I generally don't like, but I don't want to get into
that debate in this thread :D.
Take a look at the database diagram. Build the default one if you haven't already. Verify that a relationship exists between the two tables; between the Header table using the OrderID and the Detail table using its OrderID column. This will verify that you have a foreign key relationship between the two tables. Make sure similar relationships exist between all your tables in your query.
As I recall the upsizing wizard does not necessarily do a good job upsizing all the foreign key relationships correctly, so you should carefully review what it did.
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com