Results 1 to 4 of 4

Autofill form fields based on another field

  1. #1
    ljs1277 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2010
    Posts
    2

    Autofill form fields based on another field

    Please forgive me for being a noob. I have been roped into creating a new database for a courier service and this is not really an area of expertise for me.

    This is a pretty basic database in Access 07. Four tables, customers, price_list, employees, and deliveries.

    Customers:
    CompanyID (primary key)
    Company Name
    Address
    Contact

    Employee:
    Employee ID (primary key)
    Name
    Address

    Price list:
    From (Primary key)
    To
    Price

    Deliveries
    DeliveryID
    Bill To (foreign key to companyID)
    Account#
    Date
    Driver (foreign key to employeeID)
    From (foreign key to "from" in price_list)
    To
    Price

    I have set up a basic form to enter data into the deliveries table, but what I would like is to be able to choose the delivery from a drop down box on the "from" field, and automatically fill the to and price rows with the corresponding rows from the price_list table. I hope that makes sense.

    Again, I apologize if this is a stupid question, or if it has been covered before.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,328
    If the To and Price values wouldn't change, then you shouldn't store them in the Deliveries table. If they do, use a combo box that includes all three fields and in its after update event:

    Me.PriceTextboxName = Me.ComboName.Column(x)

    where x is the appropriate column (zero based).

  3. #3
    ljs1277 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2010
    Posts
    2
    That worked! Thanks a bunch!

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    12,328
    No problemo, and welcome to the site by the way!

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

Similar Threads

  1. Replies: 3
    Last Post: 10-05-2009, 06:22 AM
  2. Autofill field based on autonumber field
    By frevilla in forum Forms
    Replies: 1
    Last Post: 09-11-2009, 01:50 AM
  3. Autofill form fields
    By roboticsguy1988 in forum Forms
    Replies: 1
    Last Post: 08-10-2009, 07:56 AM
  4. Replies: 0
    Last Post: 06-03-2009, 09:25 PM
  5. Replies: 1
    Last Post: 10-26-2007, 06:29 AM

Posting Permissions

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