Hi
I have a window that populates a listBox based on some reults from a SQL query (from db1)
I now need to populate another DB with the content of that list box. (say db2)
I have a button on the windows the populates the list box (Easy to do)
There is also a button to save this content.
The code for saving back to DB is in a seperate class.
What i am trying to do is pass the listbox as a parameter. In the buttons action (on the window where the lstBox is present), i have
retCode = app.dbSnowSQL.mergeWorkSet(tbNewWorkSet.Text, _
tbWrkSetSourceConnector.Text, _
tbWrkSetTargetConnector.Text, _
escExportFolder, _
tbMaxFileSize.Text, _
lstBoxSBSchemas)
In the class, i have the method whose parameters are:-
worksetName As String,
sourceName As String,
targetName As String,
exportLocation As String,
maxFileSize As String,
lstBoxSBSchemas As Listbox
The code to process the list box content is
For Each row As ListboxRow In lstBoxSBSchemas
<>
Next
My problem is that i get the compile error:
SnowflakeSQL.mergeWorkSet, line 42
This object does not implement the Iterable interface and cannot be used in a For Each loop
For Each row As ListboxRow In lstBoxSBSchemas
I suspect the lstBox is being passed by reference and is not accessible outside of the window. I tried created a poperty at ‘app’ level of type listBox and set that property to equal the listbox in the window but to no avail.
What is the best way to do this ?
Thank you in advance.