Hmmm, well we have pop up menus and drop down lists--neither are exactly the same as a "combo box" found in other systems.
FileMaker does not use SQL as the standard option for querying the DB in order to pull up a record set such as is found in other relational DB systems. Other methods are used to do that or we find a way to use the rather limited ExecuteSQL function call to produce that result.
But you do not describe what you mean by "the script that executes the SQL code and displays that under the combo box". What exactly do you want to see happen on the screen once you have selected a value from the value list? Do you want to see a list of records where a specified field contains or is equal to the value selected in the combo box?
Yes, that's what I want.
Normally I program in Delphi. There I have a list/combo component with values. When I change that, a grid with records is refreshed and will display the new result of my query.
But I guess it's not so easy in FM. I already managed to make a report that is returning all the records of my table. That's already a start.
Now I want a system to change that report, so that only the records who match a value of the listbox are shown.
Actually it's easier to do in FileMaker as you do not need to put together an SQL query to do that.
The simplest way is to set up your value list formatted field with a global field. Then use one of the simple find scripts shown as examples here: Scripted Find Examples
In some cases, depending on the design of your value list and what fields/data you set up in your table, to use a portal to show the matching records and your value list formatted field serves as either a match field in the relationship to the portal's table occurrence or a field referenced in a portal filter that is defined as part of the portal's set up. In this case the field might not need global storage and it might work without any scripting at all.