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")
The Prepare_Fill_CB method expexts the ComboBox name and an SQLString As String. Inside the method I do the following:
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
(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:
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.