-
Hi,
Different Q this time.... :D
I can know run access reports from VB but what I would like to do is offer the user a choice from the available ones.
If I know all the reports then I can just fill up a list box and open the selected one but what I want to do is have an automatic listing ie if a new report is added, it is automatically available and I don't have to go in and add it manually.
Any ideas?
Thanks in advance
Hollie
:D
-
You should be able to use the reports collection in Access or your Access object. It goes something like AccApp.Reports(2).Name or something like that.
-
Whats wrong with this
Heres my code to generate the list of reports.
I get nothing out and temp = 0 but I have three reports!!
can anyone help?
:confused: H.
Code:
Private Sub Form_Load()
' Initialise list of reports
Dim temp As Integer
Dim temploop As Integer
Set ErrReport = CreateObject("Access.Application")
ErrReport.OpenCurrentDatabase "C:\db1.mdb"
temp = ErrReport.Reports.Count
For temploop = 0 To temp - 1
lstReports.List(temploop) = ErrReport.Report(temploop).Name
Next
End Sub
[Edited by Hollie on 11-20-2000 at 04:15 PM]