Results 1 to 3 of 3
  1. #1
    corquando is offline Novice
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    4

    World's simplest question

    Hi, all.

    I am going for the record of "World's Simplest Question."

    I'm new to Access, although a seasoned hand at Excel/VBA, so my lack of perception is frustrating.

    In the book I have obtained to help me is the following quote:

    "A one-to-many relationship is created by placing the value primary key of one table into the other table as a foreign key(empahsis mine.) For example, the customer number, which is the primary key of the customers table, becomes the foreign key of the orders table."

    In theory, fine. This is so that for every order recorded, the orders table doesn't need an additional 17 fields duplicating every customers' data every time. The link between the customer number field and the customers table takes care of that.

    The dilemma: Wouldn't there already be a customer identification field someplace in the orders table, and if there isn't, how will the insertion of the customer number fields guarantee the correct customer number will go with the correct order?



    If there already is a customer id field, then simply designating that as the foreign key for this relationship is elementary - it's the "placing into" part that I can't get my head around: Simply, when inserting the column of customer ids, "How will it know?"

    Thanks and I hope I don't sound like a whiney boob.

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Hi corquando,

    The word syntax from your book is describing what you should do if you're "designing" a database and the tables have not yet been built, or at least, filled with data.

    It appears you're asking your question (of what the book says) from the perspective that the tables & data already exist, and as you've surmised, it's a little late by then.

    Cheers,

  3. #3
    corquando is offline Novice
    Windows Vista Access 2007
    Join Date
    Feb 2010
    Posts
    4

    It's all in how you look at it . . .

    And there we have it.

    I had nightmares of having to manually enter 25000 records or some such by, as you say, coming upon the scene late, but your explanation provides the necessary perspective.

    Thanks.

    BTW, I extensively use the Excel/VBA forum that this looks to be a sister to, so finding this one is going to be a real boon. And I do search for existing answers before posting . . . usually.

    Thanks again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Simplest question...
    By andrewhunt in forum Reports
    Replies: 1
    Last Post: 01-20-2009, 10:34 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums