Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2003
    Posts
    15

    Unanswered: Combo box not updating....

    I have a problem with a combo box on a form.

    The combo box is a listing of last names from a contact list. If a new contact needs to be added, we'd like the user to upen up a new form and add all the contact info, not just the last name needed for the main form.

    For convienence, we've added a button to access the add contact form, but after a user adds the contact, the new contact doesn't appear in the combo box until the main for is closed and re-opened.


    How can I get the combo box to reflect the current contact table, and not the contact table when the form was opened?

    Thanks all, and I absolutely love this forum...it's taught me MUCH more than any class taught me in the past.

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

    Smile Re: Combo box not updating....

    Originally posted by cmbehan
    I have a problem with a combo box on a form.

    The combo box is a listing of last names from a contact list. If a new contact needs to be added, we'd like the user to upen up a new form and add all the contact info, not just the last name needed for the main form.

    For convienence, we've added a button to access the add contact form, but after a user adds the contact, the new contact doesn't appear in the combo box until the main for is closed and re-opened.


    How can I get the combo box to reflect the current contact table, and not the contact table when the form was opened?

    Thanks all, and I absolutely love this forum...it's taught me MUCH more than any class taught me in the past.
    Sorry for just putting the help topic information here but it seemed the easiest way.

    You can use this method to ensure that a form or control displays the most recent data.

    The Requery method does one of the following:

    Reruns the query on which the form or control is based.
    Displays any new or changed records or removes deleted records from the table on which the form or control is based.
    Updates records displayed based on any changes to the Filter property of the form.
    Controls based on a query or table include:

    List boxes and combo boxes.
    Subform controls.
    OLE objects, such as charts.


    Hope this helps.

    Gregg

  3. #3
    Join Date
    Feb 2002
    Posts
    108

    Re: Combo box not updating....

    This works for me.


    Private Sub cboSearchBy_GotFocus()
    cboSearchBy.Requery
    End Sub

    "cboSearchBy" being the name of the dropdown box

    You can also add the requery to the "on Enter" function and it will do the same thing.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    ... And since you're opening a contact/customer form you can have the requery fire in the Form_Activate method ...

Posting Permissions

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