FancyPrairie
Programmer
Using Access 2000
I want to populate (via the OnOpen event of the form) a Microsoft Forms 2.0 listbox. The property sheet of this ActiveX control indicates I can have more than 1 column (via the ColumnCount property) and show and hide columns (via the ColumnWidth property). However, I don't know the syntax for adding a multiple column listbox. The following function (abc) works fine. However, function (def) does not work. How do I add the other column via the AddItem method?
NOTE: For these functions to work, you will need to select the Microsoft Access 2.0 listbox via the Insert ActiveX control menu and insert it onto a form. Then name the listbox "lstFrom".
Function abc()
Dim tdf As AccessObject
For Each tdf In CurrentData.AllTables
lstFrom.AddItem tdf.Name
Next tdf
End Function
Function def()
Dim tdf As AccessObject
Dim i as integer
i = 0
For Each tdf In CurrentData.AllTables
i = i+1
lstFrom.AddItem tdf.Name, i 'Incorrect syntax. What's the correct syntax?
Next tdf
End Functin
I want to populate (via the OnOpen event of the form) a Microsoft Forms 2.0 listbox. The property sheet of this ActiveX control indicates I can have more than 1 column (via the ColumnCount property) and show and hide columns (via the ColumnWidth property). However, I don't know the syntax for adding a multiple column listbox. The following function (abc) works fine. However, function (def) does not work. How do I add the other column via the AddItem method?
NOTE: For these functions to work, you will need to select the Microsoft Access 2.0 listbox via the Insert ActiveX control menu and insert it onto a form. Then name the listbox "lstFrom".
Function abc()
Dim tdf As AccessObject
For Each tdf In CurrentData.AllTables
lstFrom.AddItem tdf.Name
Next tdf
End Function
Function def()
Dim tdf As AccessObject
Dim i as integer
i = 0
For Each tdf In CurrentData.AllTables
i = i+1
lstFrom.AddItem tdf.Name, i 'Incorrect syntax. What's the correct syntax?
Next tdf
End Functin