Results 1 to 6 of 6
  1. #1
    asmith is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    26

    refresh subform

    Hey everyone,

    I have a form that has two subforms within it. What i'm trying to do is when a particular subform field is updated that the other subform is refreshed. What i've done so far is used the code builder (VBA) under the "After Update" event for the noted field and put the code



    Forms![othersubformname].refresh

    and that did not work. I also tried the requery command with no luck.

    Can someone please help

    Thanks
    Andrew

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    You probably want Requery, and you'd need a proper reference to the subform:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    Try:

    Me.Parent.[othersubformname].Form!requery

    or

    forms![PaertFormName].[othersubformname].form!requery


    Note: Requery and refresh are not the same thing.
    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

  4. #4
    asmith is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    26
    Thanks Paul,

    Based on your reply i used the following code

    Forms!Input Form!SICS subform.form!requery

    but i still seem to get the following error:

    "... can't find the object 'Forms!Input Form!SICS subform.'"

    and i'm certain i've got the form names spelt correctly.

  5. #5
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    705
    Quote Originally Posted by asmith View Post
    Thanks Paul,

    Based on your reply i used the following code

    Forms!Input Form!SICS subform.form!requery

    but i still seem to get the following error:

    "... can't find the object 'Forms!Input Form!SICS subform.'"

    and i'm certain i've got the form names spelt correctly.

    If you have spaces in the object names then you must wrap the names with square brackets.

    Try:
    Code:
    Forms![Input Form]![SICS subform].form!requery
    or
    Code:
    Me.Parent.[SICS subform].form!requery
    Boyd Trimmell aka Hitechcoach
    Database Architect and Problem Solver
    Microsoft MVP - Access Expert
    25+ years specializing in Accounting, Inventory, and CRM systems
    "If technology doesn't work for people, then it doesn't work."

  6. #6
    asmith is offline Novice
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    26
    Thanks for the reply guys,

    I ended up doing a VB workaround that seems to work find for me. The code is:

    DoCmd.Save
    Me.Parent.Refresh

    now i just have to put another line to have it go to the next cell automatically and we're good to go

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

Similar Threads

  1. refresh a form
    By RedGoneWILD in forum Forms
    Replies: 18
    Last Post: 09-03-2010, 08:31 AM
  2. Problems with subform refresh
    By Viggen66 in forum Queries
    Replies: 2
    Last Post: 02-23-2010, 04:07 AM
  3. Refresh a list box
    By Orabidoo in forum Forms
    Replies: 9
    Last Post: 04-17-2009, 04:07 PM
  4. refresh datasheet as text changes
    By mkhan in forum Forms
    Replies: 0
    Last Post: 09-06-2008, 07:46 AM
  5. My subform doesnt refresh????? HELP!
    By LiamMurphy in forum Forms
    Replies: 1
    Last Post: 03-09-2006, 09:08 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