1.Load all the table names in my db file to a list box:
Code:
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData.AllTables
ListTblName.RowSource = ""
' Search for open AccessObject objects in AllTables collection.
For Each obj In dbs
ListTblName.AddItem obj.Name
Next obj
2.After selecting the table required in the list box,another list box then display all the fields name in this list box:
Code:
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim i As Integer
Set db = CurrentDb
Set tdf = db.TableDefs(ListTblName)
ListFieldName.RowSource = ""
For i = 0 To tdf.Fields.Count - 1
ListFieldName.AddItem tdf.Fields(i).Name
Next
3.User will be able to select which fields from which tables to see:
--->I don't understand.