Formula for selecting a dialog list option

I have a dialog list that contains months. It picks up the list of months from a Months field using the following formula:

@Explode(@ReplaceSubstring(Months;“*”;“”);“;”)

I also have another field on the form called LastMonth, which contains the most recently saved month. If this field contains a month (i.e. June), I would like the dialog list to automatically move to the June option, without the user having to select it.

Is there an at formula that I could use? I tried the following:

@If(LastMonth=“”;@Explode(@ReplaceSubstring(Months;“*”;“”);“;”);LastMonth)

This is not suitable though because instead of the list just containing the last month, I want the list to remain, but just select the last month.

Any ideas or suggestions would be greatly appreciated. Thanks in advance.

Subject: Formula for selecting a dialog list option

Hi Lisa,

Not sure exactly but try not messing with your choice formula but instead make use of your input translation and validation formulas. I haven’t done anything like this in quite some time but I know it can be achieved by using one of these events. If that doesn’t do the trick then for sure in the post open event you can check the value of the LastMonth field… if it is something then set it to be the value of the Month field.

HTH.

Mark

Subject: RE: Formula for selecting a dialog list option

I used the agent on the WebQueryOpen event. If the last month was set then I set the value of the list to that month.

Thanks, I needed another way to look at it!

Subject: RE: Formula for selecting a dialog list option

@Explode(@ReplaceSubstring(Months;“*”;“”);“;”)Instead of using a dialog list, maybe you can try the @Prompt function on a hotspot button as shown below.

@Prompt([OKCANCELLIST]:[NoSort];“Month”;“Please select a month”;LastMonth;@Explode(@ReplaceSubstring(Months;“*”;“”);“;”));

Here is a copy of the help instructions.

@Prompt([OkCancelList] : [NoSort]; title; prompt; default; choices) displays a box with the title text at the top of the box, the prompt text in the body of the box, and the choices text list below the prompt text, with the default highlighted. The last parameter must be a text list. @Prompt returns the list element, the user selects. If the user clicks Cancel, the formula terminates immediately. Do not specify [NoSort] if you want the list sorted. @DbColumn can be used to generate lists based on the current contents of views in specified databases.