Results 1 to 5 of 5
  1. #1
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60

    Combo Box on Form Simple Issue

    Hello,
    Well, slowly but surely I am plodding along...

    I have a combo box on a form, and when I select one of the options (a numeric client ID number) it fills the other form fields with the correct data. However, is there a way to make the combo box options display in a more usable way?

    Right now I have to select the actual client ID, which is an auto number and not really usable. Can I make the combo box display the First Name and Last Name (these are in two separate fields on the table), arranged by the last name, and when one is selected still fill the field with the proper Client ID?

    For example, right now I have:

    ===============
    Client \/
    ===============
    1
    2
    3
    .....

    I Would like to see:

    ===============
    Client \/
    ===============
    Jim Allen
    Bob Astler
    Caryn Coollady
    Chip Dupree
    .....



    *Even fancier would be "Allen, Jim" "Astler, Bob" "Coollady, Caryn" ... but I'll be happy with either.*

    When a name is selected, the combo box field would fill with the correlating Client ID - not the name. (I have had the work with a single name field, but when I select one I get an error - incorrect datatype - because the field tries to fill with the name, not the ID (I believe)).

    If there is a best practice to this type of thing I'm all ears.

    Many thanks.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    include those columns in the underlying record source for the combobox (if a query)

    modify the combobox properties to include additional columns

    modify the combobox properties that control the width of each column - making your first column (autonumber) to be 0 width so it isn't seen.

    Hope this helps.

  3. #3
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60
    Oh wow - this worked perfectly, thank you so much.

    I see that I am able to set a field to do this sort of lookup whether it is in the table itself or in a form - is this something you would usually want to keep on a form?

    Again, just wondering "best practices".
    Thanks.

  4. #4
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    not sure I follow your question; but generically speaking - - a combo/list box is typically used find an entire record for the form. While a 'lookup' field is field specific.

    The lookup is a nice table field feature - if used correctly. My favorite generic example is the 50 USA states 2 letter abbreviation; AK AL MN etc. It makes alot of sense to have a 50 record table with these - No need to have any key id . Then in your transaction table the 'State' field is a lookup of this info of that table - just an easy way to insert the Initials. One can apply this to any simple text info that is repeated alot and looked up - like an employee name perhaps.

    but there are alot of variations to these 2 approaches and they are not set in stone. there are valid arguments against lookup fields - but if you keep to simple data without binding key fields one it is a nice feature.

    hope this helps.

  5. #5
    anoob is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Jan 2011
    Posts
    60
    It does - thank you.

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

Similar Threads

  1. Simple issue?
    By Patience in forum Access
    Replies: 8
    Last Post: 05-29-2010, 07:02 AM
  2. Form/Combo box parameter issue.
    By Bmo in forum Forms
    Replies: 2
    Last Post: 05-06-2010, 03:41 AM
  3. Please Help, Combo Box Query Form Table Issue
    By Keeyter in forum Programming
    Replies: 9
    Last Post: 04-29-2010, 09:15 PM
  4. Issue with combo box in form
    By 57chevy in forum Access
    Replies: 1
    Last Post: 01-05-2010, 07:27 AM
  5. Simple combo box question
    By laqa in forum Queries
    Replies: 9
    Last Post: 08-03-2009, 08:32 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