set current /selected valuelist item ?

Hopefully an easy one ?

Iam trying to build a generic search form that will set some options for the user depending on how they arrived at this search form.
To do this, one thing I need, is to be able to set the current /selected item in some combo boxes.
i.e. preset the display values before showing the form but still give the user the ability to deviate from what we predicted they wanted to do
The comboboxes are populated from a custom vlauelist (not tied to a table) using the syntax
‘friendly prompt’ | indexno

The application. methods relating to valuelists don’t seem to provide this - I am looking in the wrong place presumably.
something like this ? application.setvaluelistdisplayitem(valuelist,index).

Many thanks

You can set the value of the field.

Because you have no column (and I guestimate also no global) attached to the field you are stuck…

So the answer is: attach a column or global and set the value at the onshow event of the form…

Thanks for the rapid response Marcel.
So lets see if I understand you

option 1:
Use a table to populate the valuelist then set the required current record using its databasemanager ?

Option 2:
Assign a value to a global variable - don’t see how this helps

Sorry to be a bit slow on this …

Don’t think about the valuelist, just set the value of the field in the onShow code and you’re done. If you set fieldA to 1 and in your valuelist you have “Red|1” you will see that the combo will show the “Red” value in the form. That’s what Marcel meant.

Thanks Nicola

I thought it should be easy !

That’s what Marcel meant.

Thanks buddy :)