Results 1 to 3 of 3
  1. #1
    Evans2 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Seattle
    Posts
    27

    Requery of subform data

    Hi all,

    I've got a procedure called ViewOutboundSamples that when double clicked will open my form called frmOutboundSampleEntry Within that form, I've got a subform called sfrmSampleEntryBox. I would like to requery that subform whenever the main form is opened to display any change in data. My attempts below have failed so far. Everything works without the requery bit.

    Any help with my syntax is appreciated. Thank you.

    Attempt 1:

    Private Sub ViewOutboundSamples()



    DoCmd.OpenForm "frmOutboundSampleEntry", , , , , acHidden
    Forms!frmOutboundSampleEntry.RecordsetClone.FindFi rst "[SO_ID]=" & Me.SO_ID
    Forms!frmOutboundSampleEntry.Bookmark = Forms!frmOutboundSampleEntry.RecordsetClone.Bookma rk
    Forms!frmOutboundSampleEntry.Visible = True
    Forms!sfrmSampleEntryBox.RequeryEnd Sub

    Attempt 2:

    Private Sub ViewOutboundSamples()

    DoCmd.OpenForm "frmOutboundSampleEntry", , , , , acHidden
    Forms!frmOutboundSampleEntry.RecordsetClone.FindFi rst "[SO_ID]=" & Me.SO_ID
    Forms!frmOutboundSampleEntry.Bookmark = Forms!frmOutboundSampleEntry.RecordsetClone.Bookma rk
    Forms!frmOutboundSampleEntry.Visible = True
    Me.sfrmSampleEntryBox.Form.Requery

    End Sub

  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
    53,648
    Why would you need requery immediately upon opening? Opening is a refresh of the form data.
    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
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,706
    This is rather odd code. How do you know what's happening on the hidden form?
    When you scroll through records in the main form, do the proper related records appear in the subform? If not, is that the problem you are trying to resolve?
    Perhaps if you tell us what you are trying to accomplish it would help us make constructive suggestions.
    And, where is the below code located?

    Code:
    Private Sub ViewOutboundSamples()

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

Similar Threads

  1. Subform won't requery
    By Heathey94 in forum Access
    Replies: 36
    Last Post: 09-23-2016, 10:09 AM
  2. Subform Requery
    By MTSPEER in forum Programming
    Replies: 15
    Last Post: 04-29-2015, 09:14 AM
  3. Replies: 5
    Last Post: 04-15-2015, 04:20 PM
  4. requery subform
    By nswhit in forum Forms
    Replies: 2
    Last Post: 05-16-2013, 09:34 AM
  5. Replies: 3
    Last Post: 04-17-2012, 10:28 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