Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    64

    Question Unanswered: combo box to locate records.

    I create a form that has a dropdown box working as a navigate or a search menu in the form header, when a specific item is selected, it will locate and display all the records related with this.
    Although I don't have a customer and order database, I'm using something similar with this, so just for example, select a customerID, all the orders of this customer will be displayed

    Then I add this form to a tab control.

    Everything works fine except everytime I get into the application, the search result always remember last time's search result. I checked the recordsource is to show all records but Don't know somewhere still remember last time's search.
    What I want is whenever get into the application, all the orders will be shown.

    I use refresh, requery, it doesn't help.

    Any suggestions would be appreciated

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Form a form to remember what you had a filter set to, the form must be saved. Check the code behind the form and see where it is saving the form.

    To clear the filter, add to the On_Open event the following:
    Code:
    Me.Filter = ""
    Me.FilterOn False

  3. #3
    Join Date
    Mar 2004
    Posts
    64

    Question search not refresh

    Thank you.

    Tried that too, but it seems still not fix the problem. when reopen, it still displays last search result

    I think what may cause the problem is that I add the form to a tab form.
    If I use the form itself there is no such problem.
    I also experiment to just add the form as a subfrom to a main form.
    It has the same problem.


    Any more help would be appreciated.

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    So you are creating a new sub form with the query results? If that's the case, then you are saving the form at some point. It's probably in the code, but may be set to automatically save without asking as well.

    The only way for the displayed results to change when you reopen the form is is the underlying query changed or the form changed (and was saved).

    Make sure to include the acSaveNo constant in the form close action.

    Perhaps if you could create a sample DB with just the form in questio and some dummy data so we can check it out.

  5. #5
    Join Date
    Mar 2004
    Posts
    64
    Thank you very much

Posting Permissions

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