Open report with groups hidden

Mr. SLP

Registered User.
Local time
Today, 15:11
Joined
Dec 23, 2017
Messages
56
I have a detailed report of staff, the campuses they cover, and the students on those campuses. How would I set it up to where a command button press would open the report but only show the information requested at that time I.e. list of staff, list of staff and their campuses?


Sent from my iPhone using Tapatalk
 
I'm not really clear on the setup, but in the format events of the appropriate sections (group header, etc) you can hide the section based on some criteria you test.

Edit: actually if you want them hidden for the whole report, hide them in the open or load events.
 
Make report form.
Pick a report from a listbox,bound to table tReports.
RptCaption, Report

The listbox would show the caption but the 2nd column is bound to the box.
Then a button to open the picked item.
Docmd.openReport cboRpt ,acViewPreview

If you want to use another box to pick the Staff or campus, add more combo boxes.
Code:
Sub ShowRpt_click()
Dim sWhere as string

SWhere = "1=1"
If not isNull(cboCampus) then sWhere = sWhere & " and [campus]='" & cboCampus & "'"
If not isNull(cboStaff) then sWhere = sWhere & " and [Staff]='" & cboStaff & "'"

Docmd.openReport cboRpt,acPreview,,sWhere

End sub
 

Users who are viewing this thread

Back
Top Bottom