Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    ComboBox options

    Hello, I am bulding a form and I have lookups in my table, so the form has appropriate listboxes. What I want is for the data within the listboxes to be conditional on what is in the other fields. For example, the first field in the form is 'Part Number'. The 'Part Number' only has one Customer, so once this field is entered, I would like for the listbox showing the 'Customer' to be completed with the respective customer.

    I am relatively new to Access. Thanks in advance!

  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,652
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Yes, this is what I want, but when I try to do alter for my circumstances, it is not working. Any ideas what I could be doing wrong?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Since I can't see what you've tried, no.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Inventory Record.mdb

    Ok. Here is my file. I am trying to populate the CustomerName combobox based on which part is entered. It is all in the Incoming Form.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    For starters, you've got a lookup field, so the field is numeric, not text. Second, you're referring to the wrong combo when you set the row source and such. I think the column count is also off. Personally I don't use lookup fields:

    http://access.mvps.org/access/lookupfields.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    So should I delete all of my lookups and reestablish relationships without them?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Oh, you're free to use them if you want. I just said I wouldn't. If you use them, you just need to be aware of the "gotchas".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    So you would rather have the datasheets have ID numbers that you would constantly have to look up?

  10. #10
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    dylcon,
    Lookup field are OK. sometimes. Usually never.
    I will use them is special cases. Very special.
    However you must be aware of the down falls.
    Usually you don't want the relationship.
    And you have to store some bit of data in that table you may not want or need.

    Combo boxes are far easier to work with than lookup fields.
    They do not require a relationship and you do not have to store any data.

    If you can make a lookup field you can make a combo box.

    Best practice in most cases, forget lookup field and learn to work with combo boxes.


    Dale

  11. #11
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Thanks Dale, but I thought that a lookup essentially was a combobox. How do I use a combobox without building a relationship?

  12. #12
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    dylcon,
    Lookup fields are a combo box.
    Combo boxes show multiple data.
    Lookup fields and what you THINK combo boxes are, are not the same. Confusing.

    In a form, in design view, from the the design tab, select the Combo box icon.

    From the wizard select what data you want.
    IF the form is bound or unbound your first option is.
    Data from another table.
    Just like a lookup field.

    IF the form is bound to a table/query it shows another option to find a record on your form. (Good for searching and populating your form)

    Select the option you want and follow the wizard.

    If the data is not on your form you need to find someway to search for the data from a query/table.

    Play with it in a test form awhile.
    Ask questions if you hit a hard spot.

    EDIT:
    The query that is made by the wizard appears in the Row Source of the combo.
    The WHERE clause works great here to filter. Used there all of the time.

    Dale

  13. #13
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    How would I use a combobox in the field of the table without creating a relationship via lookups?

  14. #14
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Not sure I understand.
    Combo boxes are for looking up data, usually. Like from a list.
    Forget the table and the table field.
    See the above post.

    Dale

  15. #15
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Thanks Dale

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-06-2011, 01:47 PM
  2. Replies: 29
    Last Post: 08-16-2011, 05:52 PM
  3. Replies: 5
    Last Post: 07-23-2011, 11:48 PM
  4. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  5. Replies: 0
    Last Post: 12-16-2009, 01:14 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