Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2010
    Posts
    20

    Unanswered: Combo box requery

    Hoping someone can help. I have a combo box on a subform that lists employees. I have a button on the main form to enter a new emp if they are not in the list. The on click event of the "Enter new emp" brings up a separate form for info entry, enter new emp info, close the form then click on the combo box to get new emp info.

    My problem - I can't get the combo box to refresh the data. I have tried absolutely everything I can find on how to do this and nothing is working.

    Help? Thank you!

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The cleanest way would likely be to use the not in list event of the combo, but if you're using a button, you should be able to add a requery of the combo either after the line to open the second form (but only if you open it in dialog mode) or perhaps to the close event of the second form.

    How was that for a run-on sentence?
    Paul

  3. #3
    Join Date
    Jan 2010
    Posts
    20
    Thanks pbaldy! I did put a requery in the close event of the second form and it didn't work but I'll try the not in list thing and let you know how it works!

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    The not in list is the most common way of adding items, but the requery should work too. You'd have to requery the combo itself, not the form it's on.
    Paul

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Otherwise you could try the following to requery the combobox

    Forms!MyFormName!MyComboboxName.requery

    If another form is opening, you may need to issue a Refresh command after the data is updated first.

    ie.
    Refresh
    Forms!MyFormName!MyComboboxName.requery
    docmd.close acform, me.name
    Last edited by pkstormy; 04-13-10 at 19:13.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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