I need to parse a single field from an existing table down to distinct values and then pass those values into a form (list).
I have an issue passing the values to the form.
I have setup a temporary record variable 'RecDistinct' and am successfully parsing the list down which, I have confirmed.
On my form there is a single field linked to recDistinct.Tier1.
What is displayed on the form is only the last distinct value, repeated a number of times (equivalent to the amount of records in the non-distinct table) and I am unsure how to correct this.
I must be missing something simple.
Form - OnOpenForm()
CLEAR(recDistinct);
IF Rec.FIND('-') THEN REPEAT
IF (recDistinct.Tier1 <> Rec.Tier1) THEN BEGIN
recDistinct.INIT;
recDistinct := Rec;
recDistinct.INSERT;
END;
recDistinct := Rec;
UNTIL Rec.NEXT=0;
IF recDistinct.FIND('-') THEN REPEAT
MESSAGE(recDistinct.Tier1);
UNTIL recDistinct.NEXT=0;
Many thanks in advance.
Comments
Form - OnOpenForm()
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I am using 3.7 so I can't use the FINDFIRST function.
I guess that I should mention that I am confused because my Temporary Table 'RecDistinct' does contain the correct distinct values (which I have confirmed by the Message function), but I am not sure that I am 'linking' the form field properly to the Temporary Table.
Am I correct by 'linking' the field to recDistinct.Tier1 via the SourceExpr property or should I be doing something else?
You need "SourceExpr" to link it. But you temptable didn't contain the correct records.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I can't figure out why my form is not grabbing the values that the message box gives me.
Something is missing here but I just don't see it.
Thanks for your assistance kriki.
Use this new form to show the records of the temptable and see if they are correct. If they are correct, it means your old form has some error in it. If the are wrong, it means that the values you expected are wrong.
To call a form based on a temptable: And "recDistinct" is your temptable.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!