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

    Unexpected result from a dropdown control

    Good Day all,

    On a form "QueryTimeTable" I have a control "Course" whose data source is from a field "CourseName" in a table "Course".

    Using the Control Wizard I was able to setup the populating of the "Course" control.

    When I click on the dropdown arrow on the control I can see clearly the list of name spelt out. However when the form is closed and the table is check for the selected name; instead of the string name there is the Course ID number.

    Can anyone explain this unexpected results and guide me how to correct this error?

    The code generated by the wizard in the row source field of the property sheet is:

    SELECT [Course].[ID], [Course].[Course Name] FROM [Course] ORDER BY [Course Name];



    Clearly ID is selected, but I did not include it in the selections by the wizard. When I remove it the dropdown control goes empty.

    The bound column in the property sheet is set to 1. I have experimented with other number without success.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Check the format of the combo (dropdown). The wizard has probably hidden the CourseID.
    If timeTable is a separate table then Course and TimeTable are likely joined on CourseID.

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks for your response.
    timetable is separate and course in a field in timetable so they cannot join.

    I did check the format but not sure what to look for.

  4. #4
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Actually I checked and they are not joined.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Please post a picture of your tables and relationships (relationships window).
    Also could you explain how Course and Timetable are related in plain English?
    Perhaps a brief overview of what you are trying to do would help with context.

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    The bound column in the property sheet is set to 1.
    I think your problem is there. Normally, column references in combo boxes are zero-based, that is, the first column is column(0).

    The bound Column property is an exception - the first combo box column is column 1.

    If you want the course name to be stored to the table, set the Bound Column to 2.

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

    It's working

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

Similar Threads

  1. Replies: 14
    Last Post: 09-15-2017, 11:25 AM
  2. Replies: 8
    Last Post: 01-31-2015, 11:34 AM
  3. Replies: 3
    Last Post: 04-03-2014, 10:43 AM
  4. Replies: 1
    Last Post: 01-06-2013, 01:47 PM
  5. Invalidating dropdown control on Access 2007 ribbon
    By kenwarthen in forum Programming
    Replies: 0
    Last Post: 08-16-2010, 09:29 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