Results 1 to 6 of 6
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    requery 1 subform after activity on another subform

    i have a main form frmSpec with multiple subforms: fsubSpec_Cuts and sfrmSched_imagePreview
    fsubSpec_Cuts is a continuous form with multiple fields and controls
    sfrmSched_imagePreview is a single record form (whose recordset is determined by the records in fsubSpec_Cuts

    what i would like is when the used leaves fsubSpec_Cuts (to do something on the main form... or what ever), the other subform requiries


    it seems to work when the main form changes record, and the subform consequently...
    -> behind the subform fsubSpec_Cuts

    Code:
    Private Sub Form_Current()
    Forms![frmSpec]![sfrmSched_imagePreview].Form.Requery
    End Sub
    BUT
    i can't get it to fire otherwise


    -> behind the subform fsubSpec_Cuts
    (I'm running out of events, which leads me to think that i am TOTALLY in the wrong direction ?)

    Code:
    Private Sub Form_DataChange(ByVal Reason As Long)
       MsgBox "Form_DataChange"
       Forms![frmSpec]!sfrmSched_imagePreview.Form.Requery
    End Sub
    
    Private Sub Form_Deactivate()
      MsgBox "Form_Deactivate"
      Forms![frmSpec]!sfrmSched_imagePreview.Form.Requery
    End Sub
    
    Private Sub Form_LostFocus()
      MsgBox "Form_LostFocus"
      Forms![frmSpec]!sfrmSched_imagePreview.Form.Requery
    End Sub
    
    Private Sub PrintCatalogSheet_AfterUpdate()
      Me.chkTglAllCuts = 0
      MsgBox "PrintCatalogSheet_AfterUpdate"
      Forms![frmSpec]![sfrmSched_imagePreview].Form.Requery
    End Sub
    
    Private Sub PrintCatalogSheet_Exit(Cancel As Integer)
      MsgBox "PrintCatalogSheet_Exit()"
      Forms![frmSpec]!sfrmSched_imagePreview.Form.Requery
    End Sub

    (it would be nicer if it only requiry'd after the user left the subform having done 'something' on it (ie ...it's dirty), but i'll take what i can get


    thoughts?


    (with thnx in advance,
    m.)

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Does it help knowing the Form in the SubFormControl will execute its BeforeUpdate event if the user exits after making a change?

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Do you have this link bookmarked? http://access.mvps.org/access/forms/frm0031.htm

  4. #4
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    absolutely have the bookmark !
    (it's gospel)

    hmmm
    before update ? something shifted.... enough to open some other avenues of ponder
    thnx!

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Why would sfrmSched_imagePreview need to be requeried when fsubSpec_Cuts loses focus?

    Subform container control has two events available - Enter and Exit.

    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.

  6. #6
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    and... (of course)
    it always helps if you remember when to address the container, and when to address the subform inside it

    (which fixed the problem ...quickly)

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

Similar Threads

  1. Requery a subform
    By UT227 in forum Forms
    Replies: 9
    Last Post: 07-04-2017, 04:56 PM
  2. Subform Requery
    By MTSPEER in forum Forms
    Replies: 1
    Last Post: 03-12-2015, 08:20 AM
  3. Requery Subform From another Subform
    By Njliven in forum Access
    Replies: 1
    Last Post: 08-08-2014, 08:29 AM
  4. requery in subform
    By putte11 in forum Forms
    Replies: 7
    Last Post: 04-22-2013, 02:43 PM
  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