Refresh of form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piter

    Refresh of form

    Hi

    I have a form with source of data on query "qrymultiselect "
    On this form I have a multiselect list and a button "filter"
    With click a button there is a procedure that is creating query
    "qrymultiselect " with criteria from my multiselect.
    After that I would like to refresh my form so that to get a data from
    my new query "qrymultiselect " that I created with my procedure.
    I tried forms!frmMyform .requery and me.requery but it doesnt work.
    How to make a form to refresh a date from my new query that I created?
    Thanks for any help

    Piter

  • BillCo

    #2
    Re: Refresh of form

    access glitch! it holds the info in the last created "qrymultiselect "
    in cache. when you requery it, it doesnt re-read the query, but rather
    it uses the query it remembers to re-scan the data. so what you need to
    do is re-set the control source of the list.

    function updateList()
    're-create query stuff
    me.lstName.Cont rolSource = "qrymultiselect "
    me.lstName.Requ ery
    end function

    ....will do the job nicely

    Comment

    • Piter

      #3
      Re: Refresh of form

      I think you right access glitch and doesnt re-read the query but I dont
      want to refresh data of my list (the data of my list is ok and have
      another source than form) What I want is to re-set data of my form
      (this is continuous form) and query "qrymultiselect " is the source of
      my form not of my list. Maybe this is not fortunate name for the source
      of form and can cause misunderstandin g. Sorry for that.Thanks anyway
      for trying to help.
      Piter

      Comment

      • BillCo

        #4
        Re: Refresh of form

        unfortunite naming indeed!
        I'm going to go out on a limb and say that it's probably the same
        principle at work here - that you need to re-set in code the
        recordsource of the form and then requery the form.

        me.recordsource = "qrymultiselect "
        me.requery

        Comment

        Working...