@DbLookup (Combobox & Multiple Selections + AppendText)

I have a web form with combobox that populates 5 other fields (based on user selection & @DbLookups). This works fine… now I just need to allow the user to select another option from the same combobox and it appends the information from the @DbLookups in each field. e.g. below…

1st selection:

Field1:

AAAAAA

2nd selection:

Field1:

AAAAAA

BBBBBB

Any thoughts? I thought about creating a temp. variable before executing the @DbLookup in each field. e.g. curfield := nameoffield would grab existing vfield value then create another temp. variable called newdata := @DbLookup. The field formula in the end would be curfield + @Newline + newdata. Does this sound reasonable?

Subject: RE: @DbLookup (Combobox & Multiple Selections + AppendText)

If you give it a multivalued key, @DbLookup will look up all the key values and return a list of all the matches, up to the point where a non-matching key was found. So you can just use a multivalued field and select newline as the delimitor, and display the result of the @DbLookup (with the usual error handling).

Subject: RE: @DbLookup (Combobox & Multiple Selections + AppendText)

Thanks Andre… could the issue be (blank when formula runs) that the fields are RT Lite? …noticed that multivalue is grayed out. I know that RT fields only compute once (reason I’m using @SetField). I’m temp. changing fields to text - multivalue to see what happens. Thanks for your response.

Why won’t this work (returns blank)?

oldtasks :=Tasks;

newtasks :=@DbLookup(“”:“NoCache”;“”:“test\profiles.nsf”;“Custom Lookup”; ProfileValues; “Tasks”);

@SetField(“Tasks”; oldtasks + @NewLine + @NewLine + newtasks);

This just returns blank (even when I changed RT Lite to computed text). If I only do the @SetField with the @DbLookup, it works. Next step… replace ProfileValues (the key field) with a temp. var that holds all choices.

I was able to get this simple test to work. I just replaced the field value + @DbLookup with simple text. See below…

oldtasks :=“Test A”;

newtasks :=“Test B”;

@SetField(“Tasks”; oldtasks + @NewLine + @NewLine + newtasks);

The field was set -w- NewLine as separator. Is there something wrong with using newtasks :=@DbLookup… My assumption was that oldtasks would = the current value of the field and newtasks would equal the text from the @DbLookup (from user’s selection in the combobox).