Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81

    Question Unanswered: Combo Box Default

    Is there a way to make a combo-box default to an item when a form is opened?

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: Combo Box Default

    Originally posted by jacque427
    Is there a way to make a combo-box default to an item when a form is opened?
    Yes.....in your combo box in the propriety ControlSource put the name of the item
    Saludos
    Norberto

  3. #3
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81

    ?

    I didn't understand that.

    In the properties of the combobox, I have a control source that is pulling the data from a table that has the item to choose. Changing that will not let me get the data that I need.

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    465

    Re: ?

    Originally posted by jacque427
    I didn't understand that.

    In the properties of the combobox, I have a control source that is pulling the data from a table that has the item to choose. Changing that will not let me get the data that I need.
    Make a combo box with the wizard, he do the question if you want to store the display data in some were, then selewct the name of your data field ok
    Saludos
    Norberto

  5. #5
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Combo Box Default

    Originally posted by jacque427
    Is there a way to make a combo-box default to an item when a form is opened?
    Try seting the listIndex property of the combobox in an event procedure.

    Example:
    Combo Box called cbo1

    cbo1.ListIndex = 3

    I used this on an unbound combo box and coded it to fill the box when I entered the field (Private Sub cbo1_Enter()).

    Gregg

  6. #6
    Join Date
    Nov 2003
    Location
    LONDON
    Posts
    238

    Re: Combo Box Default

    Originally posted by jacque427
    Is there a way to make a combo-box default to an item when a form is opened?
    You can use the DefaultValue of the combo box to set the combo box to a specific value when you open the form. The default value will be the column that is bound to the control.

    You can also set this in VBA, so you can change the what the combo box displays at any time. You would use code such as:

    Me("MyComboBox").Value = 5

    Or you could use:

    Me("MyComboBox").Column(2) = "Default"

  7. #7
    Join Date
    Sep 2003
    Location
    Spokane, WA
    Posts
    81

    Figured it Out

    My combo box is pulling information from another field called tocic, which is an autonumber. I used that field and it works.

    Thanks for the help.

Posting Permissions

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