StrataFrame Forum

Adding a parameter when populating combo box from BO

http://forum.strataframe.net/Topic12208.aspx

By Jason Seidell - 10/26/2007

I tried to search, and I couldn't find an answer to this question.

I have a table with various codesets that I want to use for populating combo boxes and also display in various reports

ie.  Table - codesets

Codeset    Value     Description

Version      1234      Basic File version

Version      2345      Extended File version

DataType    N         Numeric

DataType    S          String

DataType    T          Time

I have created the CodeSetBO and created a FillCodeSet(CodeSet) on the BO like the following

Public Sub FillCodeSet(ByVal CodeSet As String)

Me.FillDataTable("SELECT * FROM CodeSets WHERE CodeSet = " & CodeSet & " ORDER BY Value")

End Sub

And then when I set the PopulationDataSourceSettings to call FillCodeSet and then pass the parameter (ie. Version or DataType) to load the combo box, but I cannot figure out how to allow the parameter through.

Here is the populating code from the form.designer.vb code

ListPopulationSettings1.MethodToExecute = "FillCodeSet;System.String"

As long as I leave the System.String it successfully calls FillCodeSet but the string is NOTHING.  I have tried several variations of entering the parameter and it will fail before the sub is called with a value cannot be null error.

Any ideas??

Thanks,

Jason

By Trent L. Taylor - 10/26/2007

You can either pass it over and manually call the Requery method...or better yet, handle the ListPopulating event of the combo box.  That is the purpose of this event, it allows you to specify parms to a method that is being executed.  You can refer to the docs for more detail.  There is a nice step-by-step article showing you exactly how to do this:

Application Framework -> UI Layer -> Controls -> List Population

By Jason Seidell - 10/26/2007

Ok, thanks for pointing out the listPopulating event that worked, thanks!!!