Hi, I’m opening a form from three different forms using the RunFormLink-property on a commandbutton. In RunFormLink there’s a filter (CONST) on an option-field “Type”. In the open form I’ve put the following code in the OnInsertRecord-trigger. CASE GETFILTER(Type) OF 'PC' : Type := 0; 'Bike' : Type := 1; 'SavingWage' : Type := 2; END;
It works but I think it’s not decent code. [:I] Problem is that GETFILTER returns a text. Has anyone got a better solution?
Maybe evaluate(Type, GETFILTER(Type)) will work But I’m not sure if this is much better
Hi Mark, It works! Thanks. [:D] I think it’s much better, because now you can add an option without having to change the code.
Hi Be careful, evaluate(Type, GETFILTER(Type)) will fall over if the filter has been set to ‘PC…Bike’ Stefan
That’s right. Haven’t thought about that. But it won’t occur now considering the way we’re using it. Thanks for the attention.
You can use IF EVALUATE(…) THEN; To avoid runtime errors. Regards, Mark