Values stored in a cookie variable can be displayed in any label, literal, textbox or dropdown list control using the COOKIE function. For example, to set the ContactName field on a Customer record to the value of the ContactName cookie variable, specify this formula for the “Initialize when When Editing Record” event:
= COOKIE(“ContactName”)
The COOKIE function can also be used in the Query Wizard to filter a table based on the value in a cookie variable.
Step 1: In the Layout Editor, select a table control.
Step 2: In the Property Sheet, Queries section, select the appropriate query and open the Query Wizard (Edit…).
Step 3: In the Query Wizard, add a new WHERE clause containing a formula that restricts the contents. For example, you can show products whose category name is stored in a cookie variable with this formula:
= COOKIE(“CategoryName”)
Step 4: Build and run your application.