Results 1 to 10 of 10
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Displaying text in combobox

    I have a combobox with two columns. The first column is the bound value, but hidden (width is 0"). The second is what the user sees, and when selected it stores the value in the first column. However, if an item is removed from the list, even if it was selected in old records, the combobox will appear as blank on those old records even though the bound value exists for that record. Because the first column is hidden, the LimitToList property cannot be set to No. So now I have records that don't display properly. Is there any way to programmatically have the combobox display these old records on the form?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    What is the RowSource of your ComboBox?

  3. #3
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    A query with two columns that queries for active employees. First column is employee number, and the second is employee name. Once they are no longer flagged as inactive, they do not appear on the query, which would also mean the combobox. Now, records entered by former employee appear blank even though their employee number is in the db. I want to show their name (without them being in the list), regardless if they are active or not.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You are asking for a paradox. You may need to show *all* employees but inhibit what inactive employees do when selected.

  5. #5
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Quote Originally Posted by RuralGuy View Post
    You are asking for a paradox. You may need to show *all* employees but inhibit what inactive employees do when selected.
    I don't want them to be selected. They were in the list in the past, but now that they aren't, they don't show at all.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    They don't show because they are no longer in the RowSource of the ComboBox.

  7. #7
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    I know that, and I don't want them to. I want to know if there is a way to programatically look up the employee number is the table record, and use that to display their name in the combo box text field portion...not list.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You could display the name in a TextBox on your form using a DLookup().

  9. #9
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200
    Would there be any change that I could use something like Me.ComboBox.Text so I wouldn't need another control?

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    To what function are you using the ComboBox? You are asking to use a ComboBox an a manner to which it was not designed.

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

Similar Threads

  1. Replies: 1
    Last Post: 11-22-2011, 02:36 PM
  2. Combo Box Displaying Text, But Storing ID
    By SeaTigr in forum Forms
    Replies: 4
    Last Post: 11-22-2011, 08:58 AM
  3. Displaying primary key not text
    By Daryl2106 in forum Access
    Replies: 4
    Last Post: 09-20-2011, 12:10 AM
  4. Displaying multiple text values in crosstab query
    By MFlood7356 in forum Queries
    Replies: 6
    Last Post: 06-28-2011, 11:30 AM
  5. Replies: 2
    Last Post: 09-16-2010, 06:12 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