Results 1 to 6 of 6

Thread: Combo box

  1. #1
    Join Date
    Jun 2010
    Posts
    6

    Unanswered: Combo box

    How to bring up a field from a combo box and show it in a form and write it in a table.

    I have the combo box from a new table and i have the other information in it.

  2. #2
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by icedearth View Post
    How to bring up a field from a combo box and show it in a form and write it in a table.

    I have the combo box from a new table and i have the other information in it.
    If you are using a form that is bound (has a record source set) you would set the combo box's control source property to the desired field.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    nah
    you'd want a single form
    with the controls contianing the data you want
    place an unbound combo box in the header or foooter area
    that combo box should have the Primary Key (PK) of the row of datat you want plus whatever makes the combo bok legible to a human. so it oit was a person you may want surname followed by forenames, if it was a company the company name.
    make the combo box single sleect
    place soem code in the combo box's on click events that sets the filter or rowsource on the form.
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jun 2010
    Posts
    6
    Can you explain step by step how to do it. It's been a long time that i don't use access.

  5. #5
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by healdem View Post
    nah
    you'd want a single form
    with the controls contianing the data you want
    place an unbound combo box in the header or foooter area
    that combo box should have the Primary Key (PK) of the row of datat you want plus whatever makes the combo bok legible to a human. so it oit was a person you may want surname followed by forenames, if it was a company the company name.
    make the combo box single sleect
    place soem code in the combo box's on click events that sets the filter or rowsource on the form.
    healdem,

    You might have figured out what the OP wants. I really am not clear what they want from the brief description.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    my understanding is that he wants to use a combo box to select a specific record to display on the rest of the form

    so you need a form with the controls on, populated by the data
    you need a mechanism to specify which row to display

    if you sue the combo box as the mechanism then it needs to be unbound., otherwis changing the value of the combo box will change the value of that column.

    so
    create your form
    suggest you use the form wizard and layout for single forms
    work out what you need todisplay in the combo box, and what you will use to select the relevant record

    say its people
    you may have the PK of the persosn table as an autoghenerated ID (thats what you sue to select the record AND you need soemthing human readable say the person name.

    thats probably two columns
    < ID >< Name >
    00901 dearth, Ice
    99087 Trimmell, Boyd
    00666 healdem

    it would be a good idea to make this a query, so you have clearly specified what you want prior to building the combo box

    add a combo box

    place some code behind the relevant events.. one of the issues with combo boxes is that you can get partial matches on text.. so you need to work your way round to suss which events you need and what properties you need to work.

    in the relevant event you need some code which either filters the exisiting recordset on the form OR gets the specific row by assigning a new bit of SQL as the row source.

    of the two approaches I'd use the filter unless your combo box has 1000's of entires.. mind you I'd probably do it differently. combo and list boxes are great, but they can be rssource hungry when dealing with large datasets. sometimes its beter to use a combo box with no datat behind it, then, say , after 3..5 characters have been entered go find data that matches.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •