• Cannot successfully change the ColumnCount or Colu

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Cannot successfully change the ColumnCount or Colu

    Author
    Topic
    #353440

    Cannot successfully change the ColumnCount or ColumnWidths of a Combo Box after it is used in a form

    Interesting thing i want to do to a combo box- I want to change the combo box parameters so that I can see the bound column- but only when I press a Command Button. All other times, I don’t want to see the bound column.

    My combo box has one bound column (normally hidden) and one “choices” column. It is bound to a field in a recordset, and when i use a continuous form or datasheet to view data, the configured combo box will show meaningful descriptions instead of IDs (which is the bound column)

    I was thinking that it would be straightforward to change the ColumnCount or ColumnWidth, requery the combo, refresh the form, and I would be able to see whatever combo box column I wanted. No deal.

    I have a workaround ready, but would like to know from the experienced programmers, if what I am trying to do is possible (with reasonable effort)?

    Thank you!

    –llyal

    Viewing 0 reply threads
    Author
    Replies
    • #517007

      You can easily change it in design view of the form. Your problem is that you want to change it at runtime, and Access doesn’t like that at all. If it were me, I would simply have two comboboxes and only make one visible at once. It’s perfectly valid to have two controls bound to the same underlying field, but if you have any events associated with the combobox that only displays a single column, you’ll have to duplicate the calls in the event procedures for the second combobox.

      • #517097

        Charlotte,

        That is a solution. Thanks for verifying this Access 2K limitation.

        –llyal

        • #517107

          It isn’t an Access 2K limitation. In fact, it is possible to change forms in Access 2000 in form view, although I don’t recommend it so I never think of it.

          • #517109

            Charlotte,

            I agree, one does not want to push the “natural” limitations of Access and VBA; you only invite headache and lose time.

            –llyal

    Viewing 0 reply threads
    Reply To: Cannot successfully change the ColumnCount or Colu

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: