Results 1 to 10 of 10
  1. #1
    Autumn227 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    4

    Combo Box Won't Select Last Item in List

    I have looked through the forum for this question but none of the responses so far have dealt with my specific problem. Hoping for some assistance.

    In a "lookup" form (used to edit information linked between tables), I am using a combobox to populate the information in a subform. The combobox contains names and Unique IDs. I can select any from the list except for the last value entered. When I hover over the last value and click, it populates information in the subform for the value above the last value. Any idea why it may be doing this and how to fix it? Thanks.

    Control Source: (none)


    Row Source Type: Table/Query
    Bound Column: 1
    Enabled: Yes
    Visible: Yes
    Locked: No

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I am not sure what a lookup form is. Can you post the Rowsouce and the Column Width of your combobox?

  3. #3
    Autumn227 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    4
    The form containing the combo box field provides a lookup for the information contained in the subform (which populates with data from the relating table).

    Rowsource: SELECT (TBL)
    Column count: 3
    Column width: 1.1042";1.3125";0.8125"

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Lookup fields can get tricky and I am not good at remembering their nuances. It seems you combo is dependent on a table. I usually name the columns within the RowSource. Can you provide the names of the fields in our table?

    The properties should look something like this

    Rowsource: SELECT TBL.FieldOne, TBL.FieldTwo, TBL.FieldThree From TBL;
    Column count: 3
    Column width: 0";1.3125";0.8125"

    The zero will hide FieldOne which you want to be the Key value. This will display the first field that is not a zero width after the selection is made

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I've never seen that behavior. If you want to provide db for analysis, follow instructions at bottom of my post. Identify form involved.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    Autumn227 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    4
    It appears the issue is happening because the last names selected from the menu are the same.

    Ex. Both are Smith, even though first names and Unique IDs are different.

    Smith John 36
    Smith Kerry 67

    When I try to select Smith, Kerry, 67 --> Smith, John, 36 is selected.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you saving the ID or the name?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    Autumn227 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    4
    The 3 (ID, first name, last name) are linked in the combo box.

    Rowsource: SELECT [S TBL].[(S) Last Name], [S TBL].[(S) First Name], [S TBL].[S ID] FROM [S TBL] ORDER BY [S TBL].[(S) Last Name], [S TBL].[(S) First Name];

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    you want your combo box's first column to be your PK field (autonumber?) just suppress that first column in your combo box and show the data in the same way you are now

    (column widths 0, 1, 1, 1 or whatever)

    Then use the PK in the combo box to build your query


    EDIT:

    re-read your posts, and you never mentioned a PK, but your tables should all have one and autonumber works fine. Any time you want to relate two tables you should use a PK/FK (primary key/foreign key) to do so.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Also, advise no spaces or special characters/punctuation (underscore is exception) in names, nor reserved words as names.

    S_TBL
    S_ID
    S_LastName
    S_FirstName

    Rowsource: SELECT S_ID, S_LastName & ", " & S_FirstName AS SName FROM S_TBL ORDER BY S_LastName, S_FirstName;

    ColumnCount: 2

    ColumnWidths: 0";2"

    BoundColumn: 1
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 8
    Last Post: 05-25-2013, 05:24 PM
  2. Replies: 4
    Last Post: 07-27-2011, 09:52 AM
  3. Can't alays select an item from a list box
    By bomber in forum Access
    Replies: 0
    Last Post: 10-16-2009, 10:01 AM
  4. Replies: 8
    Last Post: 09-24-2009, 02:56 PM
  5. Combo-box to select item to edit in Form
    By DHavokD in forum Forms
    Replies: 7
    Last Post: 06-05-2009, 01:39 PM

Tags for this Thread

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