View Single Post
  #2  
Old May 8th, 2010, 01:32 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default Opening a filterable report from a form

Once a report is opened, you cannot/should not change it. All the filtering
needs to be done before the report is opened in the report's recordsource.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access


"JohnM" wrote in message
...
I am building an access database and am attempting to create a form (menu
at
startup) that I will use buttons to open other forms and reports.
I am using a blank form and adding buttons (links to the other forms and
reports). I have chosen in the wizard to Open Report under Report
Operations,
choose my report, and finish the wizard. But the button I have created
does
not do anything. I checked the Macro settings and it is missing a line.
Here is the code:

Private Sub Command7_Click()
On Error GoTo Err_Command7_Click
stDocName = "Deficiencies Report"
(missing statement)
Exit_Command7_Click:
Exit Sub
Err_Command7_Click:
MsgBox Err.Description
Resume Exit_Command7_Click
End Sub

It is missing the "DoCmd.OpenReport stDocName, "parameter"" statement.
There is a parameter of acNormal to Print Report and a parameter of
acPreview for Preview Report (Print Preview) . But I don't want to do
either.
I need to be able to just open the report as if I hunt and click on the
report from the side bar. The purpose is so that I can run filters in the
report itself.
Does anyone know what the parameter in the statement should be?

Thanks,
John