Filtering the Subform

gulamdastagirgulamdastagir Member Posts: 411
I have a Main form with source table X which includes a subform with Source Table X.

There is Date filter on the Main Form and whenver i enter the date the subform should show the filtered results

Thanks
Regards,

GD

Comments

  • ufukufuk Member Posts: 514
    You can link the Date Filter fields on SubFormLink.
    Ufuk Asci
    Pargesoft
  • gulamdastagirgulamdastagir Member Posts: 411
    date filter is not a field its just a variable of type text to get the date range from the user for filtering the subform
    Regards,

    GD
  • ufukufuk Member Posts: 514
    date filter is not a field its just a variable of type text to get the date range from the user for filtering the subform

    Then you can create a function in the subform like SetDateFilter which gets DateFilter as parameter. On the mainform call SubForm's SetDateFilter function on OnValidate and use a CurrForm.UPDATE on OnAfterValidate.

    If not clear, I can send you an example object.
    Ufuk Asci
    Pargesoft
  • gulamdastagirgulamdastagir Member Posts: 411
    :whistle: this is cool ufuk
    Regards,

    GD
  • gulamdastagirgulamdastagir Member Posts: 411
    when i enter the date into the Date filter textbox it filters the subform fine but when i clear the Date Filter it does not remove the filter from the subform
    Regards,

    GD
  • krikikriki Member, Moderator Posts: 9,110
    when i enter the date into the Date filter textbox it filters the subform fine but when i clear the Date Filter it does not remove the filter from the subform
    You also need to call the functions to send the empty date into the subform.
    The code in the function of the subform must be something like this:
    IF IdatTheDateFromTheHeader = 0D THEN
      SETRANGE("Some Date") // this will remove the filter
    ELSE
      SETRANGE("Some Date",IdatTheDateFromTheHeader);
    
    CurrForm.UPDATE(FALSE);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • gulamdastagirgulamdastagir Member Posts: 411
    ufuk wrote:
    You can link the Date Filter fields on SubFormLink.

    This works when the fields are of date but if they are boolean it doesnt work for eg


    when i set the subformlink property as below:

    TE FIELD TE FILTER
    IPE FIELD IPE FILTER


    TE,IPE Datatype Bool,fieldclass :Normal
    TE Filter,IPE Filter Datatype bool,fieldclass :Flowfilter


    thanks kriki,ufuk
    Regards,

    GD
  • ufukufuk Member Posts: 514
    I don't have problem with boolean type flowfilters. Have you checked your flowfield? (it must include boolean type flowfilter) If ok, then maybe you can try a calcfields.

    Edit: Sorry, you say that TE, IPE field is normal. But flowfilters are used to filter flowfields. So you can make some modification like changing your field type to flowfield or you can filter your field by a variable.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.