J
John Coon
Group,
I need some help with the display of tables names being displayed in a
combobox.
after connecting to the database I need to collect the names to the tables
available to me. this is where I'm having trouble. it reads the table names
but it displays
the table names on one line like
ex: sign, light,drainage, marking
I want the combobox to display like cascade down
sign
light
drainage
marking
Also I'd great appreciate any links that show how to use listview to dispay
the fields avaiable in the table that I can use a checkbox to select items
to label
in a autocad drawing
Have a great day
John
'sample I'm using
Dim wksObj As Workspace
Dim dbsObj As Database
Dim tblObj As TableDef
Dim fldObj As Field
Dim rstObj As Recordset
Dim reccount As Integer
Set wksObj = DBEngine.Workspaces(0)
On Error Resume Next
Set dbsObj = DBEngine.Workspaces(0).OpenDatabase(TextBox2.Text)
Dim strTableItem As String
Dim strValueList As String
Dim intCounter As Integer
For Each tblObj In dbsObj.TableDefs
intCounter = 1
If Left(tblObj.Name, 4) <> "MSys" Then
strTableItem = tblObj.Name
strTableItem = strTableItem & " "
intCounter = intCounter + 1
If intCounter > 1 Then
strValueList = strValueList & strTableItem
Debug.Print strValueList
End If
End If
Next
UserForm1.ComboBox1.AddItem strValueList
UserForm1.ComboBox1 = strValueList
I need some help with the display of tables names being displayed in a
combobox.
after connecting to the database I need to collect the names to the tables
available to me. this is where I'm having trouble. it reads the table names
but it displays
the table names on one line like
ex: sign, light,drainage, marking
I want the combobox to display like cascade down
sign
light
drainage
marking
Also I'd great appreciate any links that show how to use listview to dispay
the fields avaiable in the table that I can use a checkbox to select items
to label
in a autocad drawing
Have a great day
John
'sample I'm using
Dim wksObj As Workspace
Dim dbsObj As Database
Dim tblObj As TableDef
Dim fldObj As Field
Dim rstObj As Recordset
Dim reccount As Integer
Set wksObj = DBEngine.Workspaces(0)
On Error Resume Next
Set dbsObj = DBEngine.Workspaces(0).OpenDatabase(TextBox2.Text)
Dim strTableItem As String
Dim strValueList As String
Dim intCounter As Integer
For Each tblObj In dbsObj.TableDefs
intCounter = 1
If Left(tblObj.Name, 4) <> "MSys" Then
strTableItem = tblObj.Name
strTableItem = strTableItem & " "
intCounter = intCounter + 1
If intCounter > 1 Then
strValueList = strValueList & strTableItem
Debug.Print strValueList
End If
End If
Next
UserForm1.ComboBox1.AddItem strValueList
UserForm1.ComboBox1 = strValueList