Ok, here's the situation
In my DB I am generating Reports dynamically depending on which fields the user choses to see in the report. Once the report is created the user can chose to save to Report in the DB.
If the user wants to see the report againg, he can view the saved reports in a new form which contains a listbox which in turn contains the names of all the reports.
The Listbox Rowsource Property is set in the From_Load Event
Private Sub Form_Load()
Dim obj As Object
Set obj = CurrentProject.AllReports
For Each aob In obj
If aob.name <> "rptTemplate" Then
strTemp = aob.name
strList = strList & strTemp & "; "
End If
Next
lstReports.RowSource = strList
End Sub
Now what I want is allow the user to delete the Report selected in the list. He would click a button: Delete Report or whatever.
Hoewever, I can't find any method of deleting a once saved report from the AllReports collection.
I need this because the user doesn't have access to the Database window and I can't be bothered to delete be asked to delete a report everytime the user decides that he doesn't want it.
Thanks in advance
In my DB I am generating Reports dynamically depending on which fields the user choses to see in the report. Once the report is created the user can chose to save to Report in the DB.
If the user wants to see the report againg, he can view the saved reports in a new form which contains a listbox which in turn contains the names of all the reports.
The Listbox Rowsource Property is set in the From_Load Event
Private Sub Form_Load()
Dim obj As Object
Set obj = CurrentProject.AllReports
For Each aob In obj
If aob.name <> "rptTemplate" Then
strTemp = aob.name
strList = strList & strTemp & "; "
End If
Next
lstReports.RowSource = strList
End Sub
Now what I want is allow the user to delete the Report selected in the list. He would click a button: Delete Report or whatever.
Hoewever, I can't find any method of deleting a once saved report from the AllReports collection.
I need this because the user doesn't have access to the Database window and I can't be bothered to delete be asked to delete a report everytime the user decides that he doesn't want it.
Thanks in advance