Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    United Kingdom
    Posts
    56

    Red face Unanswered: Filling an unbound text field from a combo box

    How do I get Access 2000 to fill an unbound text field [Activity Name] from values from the 2nd column in a combo box? [cboActivity area]

    I've tried setting the control source of the text field to:

    =[cboActivity area].column(2)

    as advised in a reference book, but when I click away from it it changes to:

    =[cboActivity area].[column2]

    and does not work.

    Help!!

  2. #2
    Join Date
    May 2004
    Posts
    3
    If I understand you correctly, you should set the column width of the first column=0, and then specify the other column widths. this will hide(not display) the first column of your row source. Hope it's what you wanted

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    I think the best way is to use the AfterUpdate event of the combo box as I'm not sure that the other way will repopulate the text box when the combo box value changes. Besides that, it works.

    For the combo box AfterUpdate event put something like:

    me.[activity name] = me.[cboActivity area].Column(2)

    I think that should do it

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Hmmmmm .... How about:

    [Activity Name].Value=.[cboActivity area].Column(2,[cboActivity area].ListIndex)
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Apr 2004
    Location
    United Kingdom
    Posts
    56

    Talking Pesky Combo Boxes

    Thanks for all your help guys. The answer turned out to be quite simple and after my second cup of coffee it dawned on me:

    The Column property of a combo box is "zero-based," meaning that the first column (field) in the combo box's Row Source is column 0, the second column is column 1, etc.

    So I needed to put the control source of the text field as:

    =[cboActivity area].[column](1)

    Cheers,

    Rusty

Posting Permissions

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