Results 1 to 3 of 3
  1. #1
    Goodtilitsgone10 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    2

    Question Returning text from fields populated by combobox.


    I have a table in which contains records entered by various users via a form. This form contains comboboxes which I have learned populate the related field with an ID rather than the selected data from the combobox.

    Users then use another form to search the same table to find records.

    The issue is when someone searches for records the fields populated by comboboxes show the ID and not the selected text. How can I have the search form return the original data selected from the combobox?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    if you dont need the ID, then set the combo box.BOUND COLUMN to the text field instead of the id.

    if you MUST keep the ID field as bound, then put another unbound text box on the form. (invisible if you want)
    in the combo.AFTERUPDATE event when the user chooses the item, set the text box to the text in the combo.

    Code:
    sub combo_afterupdate()
      txtbox = combo.column(1)
    end sub
    this fills the text box with the column holding the text.

  3. #3
    Goodtilitsgone10 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    2
    Setting the Bound Column to the column of interest works. I could have sworn I tried this before like three weeks ago and all it did was delete the list in the combobox. I was lost and thought I had to build a query and link tables to point at the field of interest so and put that into the code for the search form JUST so that users would see a name rather than a number. I am glad I do not have to do that. I don't care if this makes the database less efficient; the table will never have tens of thousands of records or anything like that.

    Thanks for the help ranman256.

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

Similar Threads

  1. Dynamic report, populated by combobox
    By gmaster in forum Reports
    Replies: 2
    Last Post: 10-09-2014, 05:33 AM
  2. Replies: 11
    Last Post: 11-25-2013, 01:46 PM
  3. Replies: 3
    Last Post: 02-07-2013, 09:53 PM
  4. Replies: 9
    Last Post: 01-17-2013, 09:08 PM
  5. Replies: 5
    Last Post: 07-29-2011, 03:07 PM

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