Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Changing controls in child from the parent

    Can't seem to find the right syntax for the parent form to change the filter for a child and requery the RecordSource of the child. The child is "frmRoomAssignments".



    This is wrong:

    Me!Form("frmRoomAssignments").Filter = "RetYear = " & """" & gblRetreatYear & """"
    Me!Form("frmRoomAssignments").FilterOn = True
    Me!Form("frmRoomAssignments").Requery

    Thanks for any help,
    Bill

  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,518
    Try

    Me.frmRoomAssignments.Form.Filter

    I don't think you need the requery.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Hi Paul,

    I tried:
    Forms!frmRoomAssignments.Form.Filter = "RetYear = " & """" & gblRetreatYear & """"
    Forms!frmRoomAssignments.Form.FilterOn = True
    Forms!frmRoomAssignments.Form.Requery

    And, while I didn't get an error, there was no effect. I'll try your suggestion and post back.

    Happy Easter,
    Bill

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    With,
    Me.frmRoomAssignments.Form.Filter = "RetYear = " & """" & gblRetreatYear & """"
    Me.frmRoomAssignments.Form.FilterOn = True
    Me.frmRoomAssignments.Form.Requery

    I get the error: "Method or data member not found." on setting the filter.

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Are you sure that your subform control is actually called "frmRoomAssignments". That may be the name of the form that it is showing, but the subform control could have a different name.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Can you post the db here Bill?

    Happy Easter from New Zealand!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Good show Bob!

    While the form name is in fact "frmRoomAssignments", the form's control name is "Child58". So Paul's syntax suggestion plus your heads up about the control name got the job done.

    Thanks to you both,
    Bill
    (PS) And no Paul, you're right about not needing the Requery.

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

Similar Threads

  1. Parent/Child Append Question
    By davidson12 in forum Access
    Replies: 6
    Last Post: 01-15-2015, 08:15 PM
  2. Passing value from parent to child form
    By Pragmatic in forum Forms
    Replies: 1
    Last Post: 12-02-2011, 07:23 PM
  3. Child/Parent relationship
    By ErnieS in forum Forms
    Replies: 1
    Last Post: 08-20-2010, 01:22 PM
  4. Calculation using Child and Parent
    By SamanthaSamuels in forum Reports
    Replies: 3
    Last Post: 08-17-2010, 11:07 AM
  5. Parent/Child subform
    By Jerry8989 in forum Forms
    Replies: 1
    Last Post: 09-18-2009, 07:27 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