Results 1 to 6 of 6
  1. #1
    plaguepoop is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    3

    Creating two tables and having them get info from each other. (Noob Question)

    Hello everyone,

    I am very new to access and I am trying to create two tables called Customers and Orders.

    The fields in Customers are:
    CustomerID (Primary Key), First Name, Last Name, Address.



    The fields in Orders are:
    Order# (Primary Key), CustomerID, Product Purchased, Address.

    There is a One to many relationship between CustomerID in the table Customers, to the CustomerID in Orders.

    The problem I am having now is with the Address field.


    GOAL:
    What I am trying to do is have the Orders table automatically get the Address from the Customers Table.

    If that doesnt make sense, whenever I create a new Order, I want to enter the customerID, and have it get the Address data from the Customers table automatically put into the proper field in the Orders table.

    How do I accomplish this? If this is explained in a tutorial, I would be happy to read through it. I just dont know what to search for at this point.

  2. #2
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Not the answer, just a few questions :
    Why do you want to store the address in the Orders table?
    Is there a chance that, at times, the Order address might be different from the one stored in the Customer table ?
    whenever I create a new Order, I want to enter the customerID
    Usually, an Order is created against a Customer.

    Thanks

  3. #3
    plaguepoop is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    3
    Quote Originally Posted by recyan View Post
    Not the answer, just a few questions :
    Why do you want to store the address in the Orders table?
    Is there a chance that, at times, the Order address might be different from the one stored in the Customer table ?


    Usually, an Order is created against a Customer.

    Thanks
    When I say "I want to enter the CustomerID into the Order table," what I mean is that I want the Address associated with the CustomerID i input to appear in the orders address field.

    I dont want the address to be stored in the orders table, I would like for all of the customer information to be in the customer table.,

    However, I would like for it to also appear under the order table.

    The address from the Order address and Customer address will always be the same.

    When you say an order is created against the customer, this is how I want it to be.

    Usually, do the two tables have nothing but the CustomerID in common? Would a form or report be created to show all of the necessary information? (Again, Im very new to Access)





    In other words, I want the address field in the orders to "autofill" based on the information from the Customers table.

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Quote Originally Posted by plaguepoop View Post
    Usually, do the two tables have nothing but the CustomerID in common?
    Yes

    Quote Originally Posted by plaguepoop View Post
    Would a form or report be created to show all of the necessary information?
    Yes

    Quote Originally Posted by plaguepoop View Post
    In other words, I want the address field in the orders to "autofill" based on the information from the Customers table.
    Yes, that's the way it's done, but it should be done in the Form or Report. In case, you have a possibility that the Customer's address might change & you want to record the address used for a particular Order, then perhaps, storing the address in the Orders table or having another table CustomerAddresses & storing the CustomerAddressID in the Orders table can be looked in to.

    Thanks

  5. #5
    plaguepoop is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2012
    Posts
    3
    Alright thanks for the info! You answered a lot of my questions

  6. #6
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Glad to be of help.

    Thanks

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

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2012, 04:03 AM
  2. Replies: 1
    Last Post: 01-25-2012, 06:46 PM
  3. Replies: 3
    Last Post: 12-30-2011, 01:20 PM
  4. Replies: 3
    Last Post: 11-09-2011, 02:29 PM
  5. Please help noob question.
    By Deano in forum Forms
    Replies: 3
    Last Post: 01-24-2011, 12:33 PM

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