Hello Wayne,
thank you for your quick reply. Unfortunately this does not help here. Maybe I need to make a little bit better explanation. In the main function I have the following code:
data = Prepare_Fill_CB(CB_Category,"SELECT id, category FROM categories ORDER BY category ASC")
Fill_CB_test(CB_Category,data,data.Column("category").StringValue)
The Prepare_Fill_CB method expexts the ComboBox name and an SQLString As String. Inside the method I do the following:
return app.db.SelectSQL(SelectSQL)
and this works. Here I can put a string inside the brackets and it get executed.
The Fill_CB_test method expects the name of the ComboBox, the data as RowSet and the comand to fill the rowset as a string. Inside the method it does the follwowing:
if data <> Nil Then
While not data.AfterLastRow
MessageBox(Fill_Comand)
ComboBox1.AddRow(Fill_Comand)
ListBox1.AddRow(Fill_Comand)
PopupMenu1.AddRow(Fill_Comand)
data.MoveToNextRow
Wend
end if
(This is for testing purposes for the moment, only.)
Anyway, if I follow your suggestion, it will repeat only the first database entry in the Listbox, ComboBox, etc., as the Fill_Comand is executed, before it was handeld over to the method and the method can not change it, while iterating through the database rows. If I change the above statement to:
Fill_CB_test(CB_Category,data,“data.Column(”“category”").StringValue")[/code]
It will repeat in the Listbox, Combobox, etc. only the String “data.Column(“category”).StringValue” but does not fill it with the database entries.
What I’m looking for is to path this string and get it executed inside the method. Hope this is now a little bit more clear.