Results 1 to 5 of 5
  1. #1
    mmethe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2018
    Posts
    5

    Cannot get a control to populate based on dropdown control selection

    Hello all,



    I have a combo box on a form that is based upon a query. When a selection is made several unbound controls display information drawn from the dropdown box. Several of these unbound controls work fine, a couple dont and I am stumped as to why. Here is an example:

    Click image for larger version. 

Name:	1.PNG 
Views:	13 
Size:	7.2 KB 
ID:	38379

    The dropdown is named: cmbo_dest
    Its source is: SELECT qry_destinations_asc.dst_id, qry_destinations_asc.dst_name, qry_destinations_asc.dst_department, qry_destinations_asc.dst_city, qry_destinations_asc.dst_phone, qry_destinations_asc.dst_street, qry_destinations_asc.dst_state FROM qry_destinations_asc;

    The text box name has a source of: =[cmbo_dest].[Column](1)
    That text box works fine, as does Department, City and Phone

    I cannot get State (the un-named control) to populate

    If I run the SQL I get:
    Click image for larger version. 

Name:	2.PNG 
Views:	13 
Size:	17.2 KB 
ID:	38380

    So I know state is populated.

    Why cant I get state to show up? If I throw a msgbox in, I am told that [cmbo_dest].[Column](6) is NULL. The query underlying show data in the state field.

    Thank You!!!!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What is combobox ColumnCount property? Should be 7.
    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.

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You likely are out of sync as is being suggested, but I'd advise to drop the [ ] around Column as a matter of good habit. They are for encapsulating a field name, especially if it contains spaces. Column is also a reserved word for an Access property, so don't use it for any user defined name either.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    It is Column property referenced in the expression. Access automatically adds the [ ] around Column property.
    Last edited by June7; 05-11-2019 at 03:12 PM.
    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.

  5. #5
    mmethe is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2018
    Posts
    5
    Quote Originally Posted by June7 View Post
    What is combobox ColumnCount property? Should be 7.
    You nailed it! Thank You!

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

Similar Threads

  1. Unexpected result from a dropdown control
    By George in forum Modules
    Replies: 6
    Last Post: 07-11-2016, 01:09 PM
  2. Replies: 8
    Last Post: 01-31-2015, 11:34 AM
  3. Replies: 1
    Last Post: 11-11-2010, 11:00 AM
  4. Replies: 2
    Last Post: 08-03-2010, 10:16 AM
  5. Replies: 1
    Last Post: 10-19-2009, 02:37 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