From: LAP on 22 Mar 2010 15:19 For an example, I have been using MS Northwind example. One problem I have run into is adding the same item twice in an order. I am keeping track of time in my database. For instance, Project1 might be from 8:00AM to 12PM, then Project2 from 12PM to 3PM, then Project1 again from 3PM to 5PM. If you try to add the same product in the sample Northwind database, it comes up with the same error. I know the reason it is coming up is because it has to have its own primary key and cannot duplicate. How should I go around this so I can add the same "product" in the same order? Thanks for any comments.
From: Fred on 22 Mar 2010 17:46 I've only glanced at Northwind, and I think that you'll have to give a more detailed example, But it's design is for ability to do multiple sales of the same product. Roughtly speaking, for duplicated sales of the same item, you enter the item once in products, and multiple times in order details. It sounds like this is slightly different than your business. If you give a more detailed example, I think that we could suggest a way that you can make Northwind work for you in this respect.
From: Allen Browne on 22 Mar 2010 22:57 As you found, the Order Details table in Northwind has a primary key consisting of 2 fields in combination: OrderID + ProductID. I suspect Microsoft did this just as an example of a complex primary key, but it does have the limitation you pointed out. To solve it, open the Order Details table in design view, and add another field like this: OrderDetailID AutoNumber Mark it as the primary key. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "LAP" <LAP(a)discussions.microsoft.com> wrote in message news:D7BE1CB9-2708-47B3-BA9A-1D1E406A51D6(a)microsoft.com... > For an example, I have been using MS Northwind example. One problem I have > run into is adding the same item twice in an order. I am keeping track of > time in my database. For instance, Project1 might be from 8:00AM to 12PM, > then Project2 from 12PM to 3PM, then Project1 again from 3PM to 5PM. > > If you try to add the same product in the sample Northwind database, it > comes up with the same error. I know the reason it is coming up is because > it > has to have its own primary key and cannot duplicate. How should I go > around > this so I can add the same "product" in the same order? > > Thanks for any comments.
|
Pages: 1 Prev: 2003 vs 2007 question Next: Importing Tab Delimited Text File to an Existing Table in Access |