Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using Combo Box Selection to Populate Text Box Access 2010 32 bit

    I have two fields on a form - one is a combo box that shows a commodity code, industry description and commodity description (cboCommodityCode). The user selects the commodity, e.g., corn, from the list. The numeric code, say 115, is saved in the commodity code field in the underlying table. I would like the description, which is column 3 in the combo box, to be saved in the commodity description field in a table and appear in text box txtCommodityDescription on the form. The users want both the codes and descriptions to show on the form which is eventually printed and used as the cover sheet for a packet of information.

    The combo box pulls information from a reference table that contains the codes and related descriptions.

    How can I get the description to flow from the item selected in the combo box to the text box?

    I know this should be easy, but I haven't done it for a long time.

    Thanks!

    Nancy

  2. #2
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You could put a calculated field on the form and just have it showing the content of the combo box

    =cboCommodityCode.Column(2) Note the column no is 1 less than the position

    OR you could write a bit of code in the After_Update Event of the Combo Box

    [Description Field] = cboCommodityCode.Column(2)

    Where [Description Field] is the name of the field in the table that it needs to be posted to.
    Andrew

  3. #3
    2 Star Lounger
    Join Date
    Oct 2004
    Location
    Minnesota, USA
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, Andrew. I will try it and see which works best.

    Nancy

Posting Permissions

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