Results 1 to 5 of 5
  1. #1
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    Combobox selecting one available option

    Hello, I currently have a combobox that is being populated depending upon another combobox, and there is only one selection, but it is not selecting this. I want to have it selected so it can be available only for a visual for the user; I don't want them to be able to change it. If there is a better way to do this, I am open to suggestions. Thanks in advance

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Since you're only retrieving one value, instead of using Cascading Comboboxes, which is what you're now doing, create a Textbox, and in its Control Source use the DLookup function to retrieve the value, using the same 'WHERE' clause that you used when setting the RowSource of the secondary Combobox.

    By populating the Textbox using its ControlSource, in this way, it will be a Read-Only Control, which is what you want.

    Linq ;0)>

  3. #3
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    This field is not bound to a table. Only to a query so will that make a difference? Should I set the ControlSource with VBA? I am not familiar with its syntax..

  4. #4
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Now I have this:
    Code:
    tblPartInfo.RawNumber Where tblPartInfo.PartID = 15
    , but the textbox simply has "#Name?" in it.

    Additional: 15 is the PartID that is in the combobox at the time this was taken from the ControlSource.

  5. #5
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Does anyone have any ideas?

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

Similar Threads

  1. Replies: 1
    Last Post: 07-07-2012, 08:54 AM
  2. Selecting a combobox item with VBA
    By tylerg11 in forum Forms
    Replies: 6
    Last Post: 04-19-2012, 12:30 PM
  3. Replies: 3
    Last Post: 04-05-2012, 08:33 AM
  4. Replies: 2
    Last Post: 03-02-2012, 01:28 PM
  5. Selecting text - ComboBox
    By Numbat in forum Programming
    Replies: 2
    Last Post: 06-05-2006, 05:42 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