Open report with groups hidden (1 Viewer)

Mr. SLP

Registered User.
Local time
Today, 10:46
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
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 08:46
Joined
Aug 30, 2003
Messages
36,124
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.
 

Ranman256

Well-known member
Local time
Today, 11:46
Joined
Apr 9, 2015
Messages
4,339
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

Top Bottom