Results 1 to 6 of 6
  1. #1
    joee is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2009
    Posts
    3

    Select values from 3 colums with a combo box

    Hi.
    I have a combo box on a form which looks up values in a separate table and stores it in one bound field on my form. Now I would like to fill values into 2 more fields on the form when i do my selection with the combo box. When I make the drop down on the combo box I see the values which I want transferred onto the form but I cannot make it work. Is this possible to with the combo box ?
    Appreciate any assistance.Thanks in advance.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    To simply display the values in a textbox:

    =ComboName.Column(x)

    where x is the column number you want (zero based). To place the value into a textbox bound to a data field, this in the after update event of the combo:

    Me.TextboxName = Me.ComboName.Column(x)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    joee is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2009
    Posts
    3
    Thanks for quick answer.

    Sorry but I cannot make it work.
    I have uploaded a small sample DB. Please would you be able to give in keystrokes required in this DB and upload againg.
    On the form Project I want the fields Duration & Option to be filled out with values from the combo box once I make selction in field Task.
    Appreciate any help , thank you very much in advance
    Br, Joee


    Quote Originally Posted by pbaldy View Post
    To simply display the values in a textbox:

    =ComboName.Column(x)

    where x is the column number you want (zero based). To place the value into a textbox bound to a data field, this in the after update event of the combo:

    Me.TextboxName = Me.ComboName.Column(x)

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Why don't you post a db where you've actually tried it, and we'll figure out what you're doing wrong?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    joee is offline Novice
    Windows Vista Access 2003
    Join Date
    Jan 2009
    Posts
    3
    Hi again
    My problem is to understand exactly what you do. I have uploded sample DB where I have tried to follow your input for the textbox "Duration"
    If you open the form Projects you will see text box "Duration" has no connection.
    My target is to get the value selected from the combo box (field Task) into the table for 3 colums. Ie Task , Duration & Option.

    Appreciate if you can show how to in the sample DB
    Br Joee

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Like I said, you use the after update event of the combo:

    Code:
    Private Sub Task_selection_AfterUpdate()
      Me.Duration = Me.Task_selection.Column(2)
    End Sub
    If you're not sure how to start the code:

    http://www.baldyweb.com/FirstVBA.htm

    By the way, the spaces in your names are not worth the trouble in the long run.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 10-18-2010, 09:44 PM
  2. Replies: 1
    Last Post: 03-27-2010, 06:13 AM
  3. Replies: 1
    Last Post: 08-26-2009, 10:45 AM
  4. Replies: 3
    Last Post: 02-26-2009, 10:17 AM
  5. Combo box select from two fields
    By cnestg8r in forum Access
    Replies: 0
    Last Post: 10-31-2008, 10:05 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