Run multiple reports from a combo box and command button combinati

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have seen it before, a drop down list selects the report and then the
command button runs the selected report. I think there is an extra table that
has the list of reports but can't figure it out.
 
To show all reports in a combo, set this as its RowSource:
SELECT MsysObjects.[Name]
FROM MsysObjects
WHERE ((MsysObjects.[Name] Not Like "~*")
AND (MsysObjects.[Type] = -32764))
ORDER BY MsysObjects.[Name];

You can the open the report in Preview mode with something like this:
Private Sub cmdPreview_Click()
If Not IsNull(Me.cboReport) Then
DoCmd.OpenReport Me.cboReport, acViewPreview
End If
End Sub
 
Thats great, it works.
Thanks very much for your help. Everyone will be very impressed with this.

Kind regards
F Jones

Allen Browne said:
To show all reports in a combo, set this as its RowSource:
SELECT MsysObjects.[Name]
FROM MsysObjects
WHERE ((MsysObjects.[Name] Not Like "~*")
AND (MsysObjects.[Type] = -32764))
ORDER BY MsysObjects.[Name];

You can the open the report in Preview mode with something like this:
Private Sub cmdPreview_Click()
If Not IsNull(Me.cboReport) Then
DoCmd.OpenReport Me.cboReport, acViewPreview
End If
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

F Jones said:
I have seen it before, a drop down list selects the report and then the
command button runs the selected report. I think there is an extra table
that
has the list of reports but can't figure it out.
 
Back
Top