Setting OrderBy for a parent form overrides Filter property of its child

Discussion in 'Microsoft Access Form Coding' started by Mota, Dec 5, 2003.

  1. Mota

    Mota Guest

    Hi;
    I have a form with 2 sub forms.One of the subs is not linked to the parent
    form and have a filter.Now,i want to use an OrderBy property for the
    parent,and where ever i put this property (and its OrderByOn too),it
    overrides the filter of the sub and sub shows first records of its
    table,regardless of its filter.I put Sub's filter in property sheet,in Load
    Event and so on,but makes no difference.Where to put this 2 properties for
    the Parent form and its sub to not to overlap.
    Thank you so much in advance.
     
    Mota, Dec 5, 2003
    #1
    1. Advertisements

  2. Mota

    Allen Browne Guest

    Yes. I am able to reproduce your bug, even in Access 2003.

    It looks like a variation on a known bug. If you set the Filter property of
    both a form and a subform, and then remove *one* of the filters (either
    one), Access fails to recognise that the Filter is still on on the other
    (i.e. it falsely reports that FilterOn is now False for that one also).
    Guess it's not really surprising that the OrderBy property also displays
    this confusion.

    As a workaround, would it be appropriate to set the RecordSource of your
    subform instead of applying a filter? (That's assuming that the normal
    process of using the LinkMasterFields/LinkChildFields is not suitable.)

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Mota" <> wrote in message
    news:...
    > I have a form with 2 sub forms.One of the subs is not linked to the parent
    > form and have a filter.Now,i want to use an OrderBy property for the
    > parent,and where ever i put this property (and its OrderByOn too),it
    > overrides the filter of the sub and sub shows first records of its
    > table,regardless of its filter.I put Sub's filter in property sheet,in

    Load
    > Event and so on,but makes no difference.Where to put this 2 properties for
    > the Parent form and its sub to not to overlap.
    > Thank you so much in advance.
     
    Allen Browne, Dec 5, 2003
    #2
    1. Advertisements

  3. Mota

    Mota Guest

    Thank you;
    Yes,using a SQL statement (Or a Query) as its recordSource surly solves this
    problem,but i thought its not recommended if i could use simply a table.And
    if there is no way else,i have no way to do this.
    But ,the more surprising thing is that this bug still exists in Access
    2003-as u mentioned.If this is a known bug,Im wondering of hearing that for
    ACC 2003.You ,as a MVP,may report this to Microsoft,and may be in the next
    version, they pay more attention to such a small bugs.
    Any way,Thank you for ur help.

    "Allen Browne" <> wrote in message
    news:3fd06680$0$1757$...
    > Yes. I am able to reproduce your bug, even in Access 2003.
    >
    > It looks like a variation on a known bug. If you set the Filter property

    of
    > both a form and a subform, and then remove *one* of the filters (either
    > one), Access fails to recognise that the Filter is still on on the other
    > (i.e. it falsely reports that FilterOn is now False for that one also).
    > Guess it's not really surprising that the OrderBy property also displays
    > this confusion.
    >
    > As a workaround, would it be appropriate to set the RecordSource of your
    > subform instead of applying a filter? (That's assuming that the normal
    > process of using the LinkMasterFields/LinkChildFields is not suitable.)
    >
    > --
    > Allen Browne - Microsoft MVP. Perth, Western Australia.
    > Tips for Access users - http://allenbrowne.com/tips.html
    > Reply to group, rather than allenbrowne at mvps dot org.
    >
    > "Mota" <> wrote in message
    > news:...
    > > I have a form with 2 sub forms.One of the subs is not linked to the

    parent
    > > form and have a filter.Now,i want to use an OrderBy property for the
    > > parent,and where ever i put this property (and its OrderByOn too),it
    > > overrides the filter of the sub and sub shows first records of its
    > > table,regardless of its filter.I put Sub's filter in property sheet,in

    > Load
    > > Event and so on,but makes no difference.Where to put this 2 properties

    for
    > > the Parent form and its sub to not to overlap.
    > > Thank you so much in advance.

    >
    >
     
    Mota, Dec 5, 2003
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gurtz

    OrderBy (form) and ORDERBY (sql)

    Gurtz, Aug 16, 2003, in forum: Microsoft Access Form Coding
    Replies:
    4
    Views:
    370
    Dirk Goldgar
    Aug 17, 2003
  2. Barry Kaplan

    Form Modified Date changes when the orderby property is changed

    Barry Kaplan, Sep 30, 2003, in forum: Microsoft Access Form Coding
    Replies:
    2
    Views:
    217
    Barry Kaplan
    Oct 1, 2003
  3. Paul James

    how to refer to a subform when setting its filter property

    Paul James, Oct 16, 2003, in forum: Microsoft Access Form Coding
    Replies:
    8
    Views:
    272
    Paul James
    Oct 17, 2003
  4. Greg

    Setting OrderBy Property to DateDiff() on Report

    Greg, Feb 17, 2006, in forum: Microsoft Access Form Coding
    Replies:
    6
    Views:
    318
  5. Guest
    Replies:
    1
    Views:
    244
    Allen Browne
    Jan 29, 2007
Loading...

Share This Page