Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2003
    Location
    Queensland
    Posts
    17

    Unanswered: Binding more then one column in combo box

    Hi all, I want to be able to allow the user to select a name out of one table using a combo box but also have it pull out the property address as well. This data needs then to be recorded in a new table along with and other data that is filled in on the same form eg addition comments. Any help would be greatly appreciated.

  2. #2
    Join Date
    Feb 2004
    Location
    Dorset UK
    Posts
    147
    Hi,

    Unfortunately you cant have more than one bound column in a combo box.

    BUT you can get details from its other columns.

    If you create a combobox (combo1), and for example your table has these fields

    ID,Name,Add1,Add2,Add3,PostCode

    Your combo box could have all these fields but only display the name.

    If you go to the properties and make sure that column count is 6, but then the column widths are 0;3;0;0;0;0 (3 being cms, can alter this). All the other fields will not show, of course you can decide how many and what widths.

    Then if you have a command like;

    me.combo1.column(0) it will give you the ID
    me.combo1.column(5) it will give you the Postcode.

    Please note that it always counts from 0 - first column, and not 1 !!

    You'll need to make up a piece of code to grab all the other fields they have filled in and maybe use a sqlstring and Docmd to add a record to another table.

    Hope this helps a bit..

    If it doesn't tell me the field names and the table name its to go to, and I will work it out for you.

    Ken
    Last edited by Ken_Hart; 03-03-04 at 06:08.

  3. #3
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79
    I have been trying to accomplish this same type of task and have 3 databases to "fix up" I got the combo box ok and understand showing different columns. What I can't figure out is what to do with me.combo1.column(3)

    If I can take advantage of your offer to Peter Masters it would be a great service. Once I can see how one works, then I can apply it to my other databases.

    Recordset and this type of information confuses the daylights out of me.


    Simplest would be a classic movie database.

    table: Master Tarzan List
    Contains colums
    0. ID (autonumber)
    1. Movie Title
    2. Tarzan
    3. Jane
    4. Date Released
    5. Studio
    6. Comments

    This table will be used to create the combo box. and would list all Tarzan Movies

    Table: Tarzan (Movies that I own)
    Contains columns
    0-6 as well as:
    7. Format - (VHS, DVD etc)

    My form Tarzan will list movies that I own
    The Drop down box will show Movie Titles and I need information from boxes 2-6 to autofil from the drop box hidden columns.

  4. #4
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79
    Took two days but I got something to work.

    I don't know if it is what you meant or not

    I created my form with the combo box showing only Movie Title

    0;3;0;0;0;0

    Then I copied the drop down box and pasted the copy in and altered the properties to

    0;0;3;0;0

    and so forth to get all the cells to autofil.

    May not be "proper" (or maybe it is) but it works and I am proud as a peacock to figure out a functioning solution.

    Have been trying for 5 weeks and this is the first that worked.

    Thanks for letting me think out loud.

    Perplexed

  5. #5
    Join Date
    Feb 2004
    Location
    Indiana, USA
    Posts
    79

    Sounded Good

    I'm sure you experienced folks got a chuckle over my premature celebration in the last post.

    Copied cells work fine for viewing report but the don't put info into the table so don't really do anything for me.

    Another lesson learned the hard way

    Back to the drawing board

    Perplexed

  6. #6
    Join Date
    Mar 2013
    Posts
    1

    returning multiple values from a combobox

    Basically what I have is an employee list that is the source table. The form is using the employee list table to retrieve the
    EmployeeID
    LastName
    FirstName

    By selecting the EmployeeID I want to return the employeeID, LastName, and FirstName. This is all to be used for a time sheet to record employees work times. I am not experienced in using Access for this type of thing and would appreciate any help someone could offer. Thanks

Posting Permissions

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