Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cannot successfully change the ColumnCount or Colu

    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

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot successfully change the ColumnCount or Colu

    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.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot successfully change the ColumnCount or Colu

    Charlotte,

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

    --llyal

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Cannot successfully change the ColumnCount or Colu

    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.
    Charlotte

  5. #5
    Star Lounger
    Join Date
    Jan 2001
    Posts
    69
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cannot successfully change the ColumnCount or Colu

    Charlotte,

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

    --llyal

Posting Permissions

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