Results 1 to 3 of 3
  1. #1
    ztpkng is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    6

    Subform Requery Trouble

    I've tried the methods found online, but they are seemingly inconsistent for me.



    I have a 2 tables: Screws and Selections (Screws is the main info for the database, and Selections holds the current "search" parameters and will only ever have 1 row).
    I have a query: Filtered List

    Filtered list has both Screws and Selections as source tables, but they aren't linked per se. Instead, I add a criterion for each field so that they must match, such as (for the TYPE field in screws): Like [Selections]![Type]. I did it this way so that a user could enter * and get all results if desired.

    So, I have a form with subform. The form drives the single row of Selections. The subform returns a table of the filtered list.

    The problem is that I can't seem to get the on event requery to work properly. When I added the query to the form, it created "Filtered List subform". The code I'm using is:

    Private Sub Form_Current()
    [Filtered List subform].Requery
    End Sub

    I've tried putting it on the Form On Current condition, on the enter and exit conditions for the option boxes where I'm setting values for the Selections table, etc, but no matter where I add the event, it doesn't seem to consistently update the table. Can someone suggest what might be going on or how to solve?

  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
    52,902
    Is that code in the Current event of main form? Is the main form bound?

    Never seen the approach of another table for search criteria. The same can be accomplished without the second table by referencing unbound controls on form.

    Review http://www.datapigtechnologies.com/f...tomfilter.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.

  3. #3
    ztpkng is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Jun 2014
    Posts
    6
    Thanks for the tip! I like how clean that is, and for whatever reason it has fixed the other problem as well. Perhaps it wasn't pushing the info back into the table like I expected.

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

Similar Threads

  1. requery subform
    By nswhit in forum Forms
    Replies: 2
    Last Post: 05-16-2013, 09:34 AM
  2. requery in subform
    By putte11 in forum Forms
    Replies: 7
    Last Post: 04-22-2013, 02:43 PM
  3. Replies: 11
    Last Post: 09-17-2012, 02:23 PM
  4. Replies: 3
    Last Post: 04-17-2012, 10:28 AM
  5. Refresh Requery Subform
    By eww in forum Programming
    Replies: 1
    Last Post: 04-05-2011, 09:19 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