Results 1 to 5 of 5
  1. #1
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63

    Refresh Sub form SHOULD BE SIMPLE : )

    I have a form named Test Master Form it has 2 sub forms on it
    The first sub form is Named Test Equipment Form
    it has a control on it that when clicked opens a form named Readings. This is a single reecord data entry form that adds data for the information that is contained in the second Subform

    The Second sub form is a report and is named test form.
    this subform / subreport is a list view of all of the records created by the sub form control in the first subform.

    The problem I have is i need to have the second sub form which is a report named test form automatically re query.

    I can do it on a timer or on close of the form opened by the first sub form but when I try this its requiring the data in the wrong sub form. its quarrying the data on the Test Master form /Test Equipment form

    I need to figure out how to re query the data on the report that is in the Test Master form / test form
    not the Test Master form /Test Equipment form.



    I think its a simple set focus but im not sure how to set focus on a report in a subform.

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I always name subform/subreport containers different from the objects they hold, like ctrTest.

    Something like:

    Private Sub Command90_Click()
    DoCmd.OpenForm "Readings", , , , acFormAdd, acDialog
    Me.ctrTest.Requery
    End Sub
    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
    davedinger is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Location
    South Dakota
    Posts
    63
    Not sure if we are on the same page, maybe this drawing will help
    Click image for larger version. 

Name:	example.JPG 
Views:	15 
Size:	91.4 KB 
ID:	34973
    The forms are
    Master Form
    with sub form "Equipment" and a Sub Form with the report I need to re-query named "Readings"
    and
    Reading Single Form
    Data entry form probably is not relevant but it is named "Reading Single Form"
    The Control "Close" button on the Data Entry form is Control 22.
    Thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Okay, sibling subforms. Code is behind left-hand subform that opens popup form then when popup closes need to requery right-hand subform.

    DoCmd.OpenForm "Readings", , , , acFormAdd, acDialog
    Me.Parent.ctrReadings.Requery
    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.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    not sure if this works for report sourceobjects, but if it was a form, in the modal form close event

    forms!testmaster!form.testform.requery

    Where testform is the name of the subform control

    Why use are report as a subform anyway? What is the benefit?

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

Similar Threads

  1. Replies: 6
    Last Post: 01-06-2015, 12:37 PM
  2. Replies: 4
    Last Post: 10-09-2014, 07:09 PM
  3. Access 2010 Refresh VS Refresh ALL
    By Snwboarder1982 in forum Access
    Replies: 1
    Last Post: 09-09-2011, 04:07 PM
  4. Refresh Form
    By tpcervelo in forum Forms
    Replies: 7
    Last Post: 02-07-2011, 08:03 AM
  5. refresh a form
    By RedGoneWILD in forum Forms
    Replies: 18
    Last Post: 09-03-2010, 08:31 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