Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511

    Question Unanswered: Can combo box rows be disabled?

    I have 2 lists in combo boxes and would like to control enabling and disabling rows in box #1 depending on what is selected in box #2.
    The syntax: Me!cboLIST1.Row(1).Enabled = False causes and error.

    Is this something combo boxes were never meant to do?

    I realize I can change the RowSource property of box #1, but I want to keep all the values visible, with some grayed (the disabled ones).

    Thanks.
    Jerry

  2. #2
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    I don't think you can "grey out" values but you could change the row source for the combo box to exclude the values you don't want the users to select.

  3. #3
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511

    Cool

    To: xander, I didn't think rows in a combo box could be disabled. My solution therefore takes a different turn: when an item in combo box #1 (a category-type field from the same table as the detailed data in combo box #2) is clicked in combo list box #1, the rowsource for box #2 is changed, to display only items in the selected category.

    My code:

    Me!cboBOX2Data.RowSource = "SELECT DISTINCT [MyTable].[DescriptionField] , [MyTable].[CodeField] FROM [MyTable] WHERE [MyTable]![CategoryField] = [Forms]![MyForm]![cboBOX1Categories] ORDER BY [MyTable].[DescriptionField];"

    Thanks.
    Jerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •