Results 1 to 5 of 5
  1. #1
    wtucker is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Jun 2017
    Posts
    50

    Form Button Macro "Run Query" won't Update Search

    Hello Everyone,



    I've been tasked with some database creation, but I'm a novice. Currently, I have a form that connects to a query, in which I enter partial/complete information and hit a "run query" button to return results in a query.

    One issue I'm having is that to refresh the search, I have to close the query first. I'd much rather be able to hit the "run query" button and have the results automatically refreshed based on the new criteria. Furthermore, I'd like to house the results as a subform instead of having a query pop up. I've spent hours looking for the right information, but oftentimes it's more than I can parse. Is there any advice anyone can offer me on this? I'd really appreciate it.

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Not so hard. In the form design view, drag the query from the navigation pane onto the form. That should create your subform.

  3. #3
    wtucker is offline Advanced Beginner
    Windows 8 Access 2016
    Join Date
    Jun 2017
    Posts
    50
    Creating a sub-form isn't the difficult part. Getting it to update the results when I hit the button is.

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The form and the subform should have different control sources. Generally when entering data into a form a table is used as the record source, altho a simple query can also be used. The query for the subform would then display all the data from above, sometimes with additional information.

    When the data is the same, you need to trap the "update" action, i.e. the point in time when the new data is stored on the table. Entering information into a text box does not change the underlying table so the subform's data will not change.

    Explain your entering process to us so that we can help you determine when would be a good time to refresh the subform.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Are you using dynamic parameterized query? I never do.

    Don't open query, requery form the query is bound to.

    Review http://allenbrowne.com/ser-62.html
    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. Replies: 6
    Last Post: 11-30-2016, 12:52 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. Replies: 11
    Last Post: 02-22-2015, 01:25 PM
  4. Replies: 0
    Last Post: 01-11-2012, 12:34 PM
  5. Replies: 3
    Last Post: 08-10-2010, 02:12 PM

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