Results 1 to 3 of 3
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    Displaying Combo box values

    Good Day All,

    My combo Box source values is a query with 2 fields: ID and Name. The ID values are numerical and the Name values are string.

    In the property sheet the column count is 2 and the bound column is 1.

    when loaded the combo box displays the Name values - which is strange because in the query the 1st column is the ID



    However when a button is added and coded using cboEmployee.value, the ID value is displayed and not the expected string values

    Can anyone explain why I am not getting the string values that are seen in the combo box?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Look at the "Column Widths" property of the combo box which can be set to hide/show columns. A setting of 0cm;2cm would hide the first but show the second.
    However when a button is added and coded using cboEmployee.value, the ID value is displayed and not the expected string values
    The columns of a combo box can be refered to by number but start with 0 for the first an 1 for the second etc so try:
    cboEmployee.Column(0) to return the first column
    edit:
    cboEmployee.Column(1) to return the second column
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks. It works

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

Similar Threads

  1. Displaying only unique values
    By MCCDOM in forum Forms
    Replies: 8
    Last Post: 11-13-2014, 06:14 AM
  2. Displaying Zero Values from Queries
    By seageath in forum Queries
    Replies: 2
    Last Post: 12-13-2011, 02:39 AM
  3. displaying the number of each values
    By hklein in forum Queries
    Replies: 3
    Last Post: 09-02-2011, 09:27 AM
  4. Displaying Multiple Values, Storing One.
    By greatfallz in forum Forms
    Replies: 10
    Last Post: 08-02-2011, 01:18 AM
  5. Replies: 9
    Last Post: 12-13-2010, 09:25 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