Hi,
In my program I use an Access(2003) Database. I've made some reports in it which the user can open within my program.
Now I want to fill a combobox with the reports from the database at the start of the program. This way I don't have to program the reports in the code of my program, but I can fill the combobox dynamically.
I have made 2 reports but I can't get the combobox filled. Does anyone know how to do This?
This is the code I have until now:
I use this reference:
Microsoft Access 11.0 Object Library
As imports I have this:
Imports Microsoft.Office.Interop.Access
Code:
Dim i as integer
Dim Accessapp As New Microsoft.Office.Interop.Access.Application()
Accessapp.OpenCurrentDatabase(DatabaseDir)
for i=0 to Accessapp.Reports.Count-1
combobox1.add(Accessapp.Reports.Item(i))
next i
Accessapp = Nothing
In my program I use an Access(2003) Database. I've made some reports in it which the user can open within my program.
Now I want to fill a combobox with the reports from the database at the start of the program. This way I don't have to program the reports in the code of my program, but I can fill the combobox dynamically.
I have made 2 reports but I can't get the combobox filled. Does anyone know how to do This?
This is the code I have until now:
I use this reference:
Microsoft Access 11.0 Object Library
As imports I have this:
Imports Microsoft.Office.Interop.Access
Code:
Dim i as integer
Dim Accessapp As New Microsoft.Office.Interop.Access.Application()
Accessapp.OpenCurrentDatabase(DatabaseDir)
for i=0 to Accessapp.Reports.Count-1
combobox1.add(Accessapp.Reports.Item(i))
next i
Accessapp = Nothing