Results 1 to 3 of 3
  1. #1
    alexb1373 is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    2

    Auto fill a column based on a selection in another

    Hi,

    I'm fairly new to Microsoft Access, and have been teaching myself how to use it over the past couple of months.

    In my database I have a table of customers and a table of orders (where many customers have more than one order, so the primary keys for each table are customerID and orderID).

    In the orders table, the first columns are:

    OrderID CustomerID Customer Forename Customer Surname

    I need my table to auto fill in the customer forename and surname based on the selection of customerID (the names are saved in the customers table).

    I already have a lot of data filled in, so am looking ideally for a way to fill these name columns without having to re-input all the data.

    I'm sure there's an easy way to do this, but I can't find it!

    Thanks,



    Alex

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Alex, hopefully, this is something that will help.

    http://www.baldyweb.com/Autofill.htm

  3. #3
    alcapps is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    292
    You can use combo box for customerid field
    event after uupdate
    set me.forename = me.cbocustomerid.column(1)
    set me.surname = me.cbocustomerid.column(2)

    set cbocustomerid data source select customerid, forename, surname from customer order by forename, surname
    column count = 3
    column default = 1
    column widths = 0;1;1

    hopemthis helps

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

Similar Threads

  1. auto fill name based on file number
    By mark_w in forum Forms
    Replies: 13
    Last Post: 08-03-2012, 04:59 AM
  2. Replies: 10
    Last Post: 11-21-2011, 02:56 AM
  3. Replies: 15
    Last Post: 04-01-2011, 11:41 AM
  4. Auto fill a due date column in a query
    By Dexter in forum Queries
    Replies: 7
    Last Post: 02-23-2011, 07:00 AM
  5. Replies: 2
    Last Post: 12-07-2010, 12:32 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