How to prevent lookup on form with condition

I can set the VISIBLE and EDITABLE based on a user check, but how do I prevent the LOOKUP for the same users?

For example:

CurrForm.LOOKUPMODE := TeamFilterExists = FALSE;

If the above is correct, where do you put that on the Form or do you have to use the table?

OK I found it, it has to be on every field in the form where a lookup is possible.

Code - OnLookup(VAR Text : Text[1024]:wink: : Boolean

CurrForm.LOOKUPMODE := TeamFilterExists = FALSE;

solution is in the post, I did not delete it in time.

Still, that may be helpful for someone.