Results 1 to 9 of 9
  1. #1
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154

    Requery Problem

    Dear all is me again, for the Requery



    I tried and set the following in the unbound box

    Private Sub Pay_search_AfterUpdate()


    Me.Pay_search.Requery
    End Sub

    Still it does not work ...i have to close the Query and let it reopens to get the new result.

    https://www.dropbox.com/s/b18dexj22q...ery.accdb?dl=0

    Appreciate any help.

    Eric

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Duplicate thread https://www.accessforums.net/showthread.php?t=67819

    If you want to refresh a query or report object, why are you requerying combobox?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    Then, how I can get the result?
    ,user can re enter the request and the query can be updated without closing it
    Eric

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    I tried and set the following in the unbound box
    This statement: Me.Pay_search.Requery is requerying the combo box, and nothing else. You are using the combo box to select a name - but why do you requery it - there seems to be no point.

    After a name is selected from the combo box, what exactly to you want to happen? What query are you talking about when you say "...i have to close the Query and let it reopens to get the new result."

    If I understand you correctly, you have a SELECT query open, and you want to change the results in that query when you make a change in the combo box selection.

    So that we can better see what is happening, please post the SQL of the query you have open, and want to refresh.

  5. #5
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    John

    I want to requery the Query.

    After the user reinput the combox

    How can i do it ?

    Eric

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    So if the query has to close and reopen, code the button like this:

    Attachment 30214
    Last edited by davegri; 09-05-2017 at 07:30 AM. Reason: clarif

  7. #7
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    There is no method to requery a query. You have to close and rerun it; in fact that is what Access does anyway when you use the requery method.

    I'll ask you again - please post the SQL of the query. I want to know what you are changing that requires the query be reun, e.g. are you referencing a form field in the query's criteria clause.

  8. #8
    Erictsang is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    154
    John

    Frankly, it a new baby for Access

    SELECT Master_Data.ID, Master_Data.Title, Master_Data.Fname, Master_Data.Hotel, Master_Data.Reg_Fee, Master_Data.Reg_Paymode, Master_Data.ACC_TTL, Master_Data.ACC_Paymode
    FROM Master_Data
    WHERE (((Master_Data.Reg_Paymode)=[Forms]![Pay_search]![Pay_search])) OR (((Master_Data.ACC_Paymode)=[Forms]![Pay_search]![Pay_search]));

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    The only way I can see to refresh an open query is for the query to have focus and then click the RefreshAll button on the ribbon.

    Finally answers my question posed in other thread about whether the query has dynamic parameters.

    Again, why do you even need to have query open? Just open form or report using query as RecordSource. Methods to requery an open report have already been provided in your other thread.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. AfterUpdate requery does not requery list box
    By ittechguy in forum Programming
    Replies: 5
    Last Post: 09-05-2017, 08:51 AM
  2. Problem with requery statement
    By crowegreg in forum Forms
    Replies: 2
    Last Post: 09-15-2014, 09:26 AM
  3. Cascading Combo Boxes Requery Problem
    By Jo22 in forum Forms
    Replies: 9
    Last Post: 01-28-2012, 09:41 AM
  4. Problem in requery of reports in acess 2003
    By pratim09 in forum Reports
    Replies: 1
    Last Post: 08-02-2011, 07:28 AM
  5. Drop down box requery problem
    By Nicholas in forum Forms
    Replies: 1
    Last Post: 08-11-2006, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums