How to filter on a list form

tazzy30tazzy30 Member Posts: 52
Hello all,

I have a form which has a customer No. and item fields (each item has a customer no. and could have more than one) when a user clicks on assist (on item field) the item list appears i need this list to show only those items which have the same customer no. as the previous form only, the item list does not have a customer No. it is linked through another table, i'm not sure how to pass through the Customer No. to the list to then be able to filter on it.

Can anyone help please?

Comments

  • garakgarak Member Posts: 3,263
    As i understand it correct, you have these two tables.

    Table A like the item Table with an field where the main customer is stored
    Item No., Main Customer No., Some Other Item Fields

    Table B (to store all custmers who has this item)
    Item No.,Customer No.

    Now if you click on your item field in your form which is based on Table A, you want to show all items (in the form based on A),
    where your "Main Customer No." is a customer in Table B :?:

    Like: Show me all Items from Table B where the Customer No. = Table A.Main Customer No.

    Correct?
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,307
    If a relationship of one field depends on the value of another field, then you define this filter in the tablerelationship.
  • tazzy30tazzy30 Member Posts: 52
    yes garak you are right sorry i couldn't explain it clearer
  • tazzy30tazzy30 Member Posts: 52
    do you have an example of this please?
  • garakgarak Member Posts: 3,263
    Did you really need it to show in the same form (need C/AL) or is as also possible, that a filtered form, based on Table B can be opened :?:
    If this is no problem, you can define in Table A a FLOWFIELD with the Calcforumla: Count(TableB WHERE (Customer No.=FIELD(Main customer)))

    regards
    Do you make it right, it works too!
Sign In or Register to comment.