Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / December 2006

Tip: Looking for answers? Try searching our database.

One Report two parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Access Africa - 07 Dec 2006 09:21 GMT
I have a report that I want to pass to parameters on.
SELECT Responses.[Name of Business], Responses.[Main Category], *
FROM Responses
WHERE (((Responses.[Name of Business])=[Forms]![Main Reports].[BN]) AND
((Responses.[Main Category]) Like [Forms]![Main Reports].[cat] & "*"))
WITH OWNERACCESS OPTION;

When I open the report from the database window it works (I have to put in
the info)
But when I try to open the report from the form Main Reports it is blank?
The button that I created to open is:
Private Sub Command16_Click()
On Error GoTo Err_Command16_Click

   Dim stDocName As String

   stDocName = "Responses1"
   DoCmd.OpenReport stDocName, acPreview

Exit_Command16_Click:
   Exit Sub

Err_Command16_Click:
   MsgBox Err.Description
   Resume Exit_Command16_Click
   
End Sub

What am I doing wrong?
I have a similiar report that works - the only diffrence is the report only
has one parameter.
Marshall Barton - 07 Dec 2006 18:02 GMT
>I have a report that I want to pass to parameters on.
>SELECT Responses.[Name of Business], Responses.[Main Category], *
[quoted text clipped - 14 lines]
>    stDocName = "Responses1"
>    DoCmd.OpenReport stDocName, acPreview
[...]
>End Sub
>
>I have a similiar report that works - the only diffrence is the report only
>has one parameter.

The form must be open, of course, and the controls need to
have their values set, particularly the BN control.  If the
controls are bound to data fields, then you need to navigate
to the appropriate record before opening the report.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.