B
bfuenz via AccessMonster.com
I created a database that gives me the names of all the tables in Access
including the Sys tables. I also created code to remove the Sys tables and
to show me only the user created tables. All of this happens on a click and
the data is brought into a List box. The list box is populated not through a
table or query but by the rowsource being filled out through a str SQL
procedure. The code looks like this:
***
Private Sub cmdListTables_Click()
Dim db As Database
Dim varstr As String
Dim tdfLoop As TableDef
Dim i As Integer
Set db = CurrentDb()
With db
For Each tdfLoop In .TableDefs
varstr = varstr & tdfLoop.Name & ", "
Next tdfLoop
End With
Me.List0.RowSourceType = "Value List"
Select Case Me.List0.RowSource = varstr
Case Is = Me.List0.RowSource = "MSysAccesObjects, MSysAccessXML,
MSysAces, MSysNavPaneGroupCategories, MSysNavPaneGroups,
MSysNavPaneGroupToObjects, MSysNavPaneObjectIDS, Objects, Queries,
Relationships"
Me.List0.RowSourceType = "Table/Query"
Me.List0.RowSource = "SELECT MSysObjects.Name FROM MSysObjects WHERE ((
(Left([Name],4))<>'MSys') AND ((MSysObjects.Type)=1)) ORDER BY MSysObjects.
Name;"
End Select
End Sub
***
What I want to do now is use that populated Listbox (List0) and have the user
select one or many of the records and have it (the selected records) move to
another list box. I want to this without having to create a table or query.
Is that possible? Any help would be appreciated.
including the Sys tables. I also created code to remove the Sys tables and
to show me only the user created tables. All of this happens on a click and
the data is brought into a List box. The list box is populated not through a
table or query but by the rowsource being filled out through a str SQL
procedure. The code looks like this:
***
Private Sub cmdListTables_Click()
Dim db As Database
Dim varstr As String
Dim tdfLoop As TableDef
Dim i As Integer
Set db = CurrentDb()
With db
For Each tdfLoop In .TableDefs
varstr = varstr & tdfLoop.Name & ", "
Next tdfLoop
End With
Me.List0.RowSourceType = "Value List"
Select Case Me.List0.RowSource = varstr
Case Is = Me.List0.RowSource = "MSysAccesObjects, MSysAccessXML,
MSysAces, MSysNavPaneGroupCategories, MSysNavPaneGroups,
MSysNavPaneGroupToObjects, MSysNavPaneObjectIDS, Objects, Queries,
Relationships"
Me.List0.RowSourceType = "Table/Query"
Me.List0.RowSource = "SELECT MSysObjects.Name FROM MSysObjects WHERE ((
(Left([Name],4))<>'MSys') AND ((MSysObjects.Type)=1)) ORDER BY MSysObjects.
Name;"
End Select
End Sub
***
What I want to do now is use that populated Listbox (List0) and have the user
select one or many of the records and have it (the selected records) move to
another list box. I want to this without having to create a table or query.
Is that possible? Any help would be appreciated.