I am trying to query a stand alone table. I have some code that I can select records in the table but need to send the selected records to a list box in a form.Right now I am simply running the query from a button on a form. I can later move this run on form open.I assume that I would have to loop through with the query and set it to the list box....but I am confused on how to do this. Maybe soemthing like this?Any thoughts? Dim varquery As Variant For Each varquery In Something frm_Images.ListBox1.AddItem ("ADD VALUE") Next vFile
Dim pDoc As IMxDocument
Dim pStandaloneTableColl As IStandaloneTableCollection
Dim pStandaloneTable As IStandaloneTable
Dim pSelectionSet As ISelectionSet
Dim pTableSelection As ITableSelection
'Get the table collection from the map
Set pDoc = ThisDocument
Set pStandaloneTableColl = pDoc.FocusMap
'Get the first table
Set pStandaloneTable = pStandaloneTableColl.StandaloneTable(0)
'Select rows based on a query filter
Dim pQf As IQueryFilter
Set pQf = New QueryFilter
pQf.WhereClause = "UNIQUE_ID1 = 335"
Set pSelectionSet = pStandaloneTable.Table.Select(pQf, esriSelectionTypeIDSet, esriSelectionOptionNormal, Nothing)
'Apply the selection
Set pTableSelection = pStandaloneTable
Set pTableSelection.SelectionSet = pSelectionSet