Results 1 to 3 of 3
  1. #1
    mattmurdock is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    11

    How to auto populate a field after combo box selection


    I have a form called "New Item Form" that has a three combo boxes- Size, Price and Upcharge. Price is determined by the Size. I have a query for Size and Price (SizePrice). How do I get my form for when size is selected, it auto fills in the price? My dB is attached.


    I'm kind of new to access so the most clear and direct directions (like step by step) would be greatly appreciated. Thank you in advance!
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Does this help?

    BaldyWeb - Autofill
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jwill is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Mar 2012
    Location
    MD
    Posts
    67
    mattmurdock...

    I looked at your database and it needs to be what is called "normalized". This will help w/ the combo boxes as well.


    1. In the NDP table and the Cansize(oz) field, only the ID number from the table Can_Size should go in there. If not, you have duplicating info. Like have the same phone number in two place in your db, it's unnecessary. I would remove the lookup feature from the Cansize(oz) field in NDP (or delete the column and re-create it).

    2. If the price is always dependent on the can size, then these should be in the same table (move price column from the NDP table to the can_size table, rename the cansize(oz) column in NDP to something like cansizeID (because it can get confusing), and delete the price table being sure to populate the prices in the can_size table before you delete it). Here is how the can_size table should look:


    Field Name Data Type
    ID Autonumber
    CanSize(oz) number
    price number

    3. Erase the one record you have in NDP (remember it if you need to) and create a relationship between ID (in the Can_size table) and cansizeID(in the NDP table)

    4. Recreate your sizeprice query like this:

    Code:
    SELECT *
    FROM NDP INNER JOIN can_size ON ndp.cansizeid = can_size.id;
    5. Base your form on the sizeprice query

    6. Go to properties on your Can Size combo box and make the

    control source = cansize.ID
    row source = SELECT * FROM can_size;
    bound column = 1


    7. Change your price combo box to a text box; set control source = price


    This should cause your prices to auto populate. You may want to pick up a comprehensive Microsoft Access book, this will help a lot with not only Access feature but will help some w/ structure. Hope this helps.

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

Similar Threads

  1. Replies: 6
    Last Post: 04-27-2012, 01:31 PM
  2. Replies: 33
    Last Post: 01-13-2012, 07:44 AM
  3. Replies: 4
    Last Post: 01-24-2011, 07:11 PM
  4. Replies: 2
    Last Post: 12-07-2010, 12:32 PM
  5. auto populate combo field?
    By myboii in forum Access
    Replies: 8
    Last Post: 07-09-2010, 05:46 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
  •  
Other Forums: Microsoft Office Forums