Results 1 to 7 of 7
  1. #1
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89

    Refreshing data in a subform drawn from a query

    Hi guys,
    I haven't posted here in a while, I have received lots of help and advice in the past. I'm working on a new version of an 'MRP' that I've been trying to put together for some time and have a few bugs. This first one looks like it should be simple but I've done a bunch of research and either I'm being dense or it's not as simple as I thought.
    I have a series of tabbed subforms. One of the subforms pulls from a query that in turn is fed by data from a table bound to another of the tabbed subforms (A completely different issue to solve another time). If I change the value in the second subform and then go to the first one the data in it remains unchanged, but if I press F5 the data in the subform refreshes and I get the new values.
    I don't want to have to press F5. I have tried a couple of things that I found after searching around, such as me.Requery for various events and wonder if I am just not understanding how to apply these fixes.

    Any advice?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    How exactly do you do this?
    If I change the value in the second subform
    Do you have some code to validate that new value? If yes, can you post that code?

  3. #3
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    BCMRP1.zipThe second subform is just a continuous form where I can enter numerical values. Those values then go through a series of queries (Probably very clumsy) and the last query output is displayed on the first form, the one I want to 'refresh' without hitting F5. There's no code, just the tables and queries.
    In the attached file the main form is frmAssemblies, the subforms are subfrmAssyPricing (Contains the query output) and subfrmRFQQTY (Where the numeric values are entered).

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I'm on an iPad right now so can't look at the sample, but try requerying the first subform from the after update event of the second. Syntax here if needed:

    http://www.theaccessweb.com/forms/frm0031.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    You say "In the attached file the main form is frmAssemblies, the subforms are subfrmAssyPricing (Contains the query output) and subfrmRFQQTY (Where the numeric values are entered)."

    So you are using frmRFQQTY to enter values and which Form do you want to Refresh?



  6. #6
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    Best I can do is now when you enter data into the First Subform and then click into the Assembly Pricing Subform the values refresh
    Attached Files Attached Files

  7. #7
    khayward is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Apr 2017
    Location
    Oregon
    Posts
    89
    Thanks everyone for your replies, with the long weekend I forgot to check back for responses. Thanks Mike for the sample with the procedure - that's what was hanging me up is that I'm unfamiliar with writing those out and what I found in books and on web pages didn't include those parts, in fact most of them just had 'me.requery' as the whole thing.

    Refreshing the data in that subform was all I needed at the moment, I know the way I have things set up is clunky and a bit slow. I am slowly teaching myself these things. I think I have tables and normalization down and am now trying to get the hang of something more than a select query. What's throwing me off a bit is calculations. Anyhoo, a topic for another post, thanks for the assistance!

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

Similar Threads

  1. Subform data not refreshing
    By Freddie81 in forum Forms
    Replies: 5
    Last Post: 09-17-2018, 12:10 PM
  2. Refreshing Subform Data
    By swenger in forum Forms
    Replies: 16
    Last Post: 06-09-2016, 12:38 PM
  3. Refreshing a subform
    By RobRoy in forum Forms
    Replies: 8
    Last Post: 07-22-2013, 04:19 PM
  4. Replies: 7
    Last Post: 11-13-2012, 01:44 PM
  5. Refreshing a subform?
    By Shag84 in forum Forms
    Replies: 4
    Last Post: 08-07-2011, 10:07 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