Print part only of a report

PeteB

Registered User.
Local time
Today, 15:50
Joined
Mar 15, 2016
Messages
78
I have an inventory database within which I have created a grouped report to return records for all items based (grouped) on 'Location'.
I need to print the records returned for a particular location at any one time.
How would I do this?
Help from the experts would be much apprceiated.
 
on the Report Load Event, add an InputBox asking for a particular Location, eg:

Private Sub Report_Load()
Dim strLocation As String
strLocation = Inputbox("Enter [Location] or leave blank to include all", "Location")
If strLocation <> vbNullstring then
Me.Filter="Location Like """ & strLocation & """"
Me.FilterOn=True
End If
End Sub
 
Hi Arn
Thanks very much for that - what do you mean by 'Input Box'? (you are dealing with an amateur here).
 
Options:

1. simplest is to manually set static filter criteria in query used as report RecordSource

2. Use dynamic parameter input popup in query

3. VBA code to dynamically pass filter criteria to report when it opens - arnelgp provides example of one approach

Review http://allenbrowne.com/ser-62.html
 
Hi Arne
Thanks for that. I will try and absorb the information you posted and I'm certain will be able to go with one of your options.
 
The DoCmd.OpenReport method takes a where clause. Use that. There is no reason to write code when property settings will do the job more efficiently.
 

Users who are viewing this thread

Back
Top Bottom