A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

One Report two parameters



 
 
Thread Tools Display Modes
  #1  
Old December 7th, 2006, 09:21 AM posted to microsoft.public.access.reports
Access Africa
external usenet poster
 
Posts: 13
Default One Report two parameters

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.
  #2  
Old December 7th, 2006, 06:02 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default One Report two parameters

Access Africa wrote:

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

[...]
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.

--
Marsh
MVP [MS Access]
  #3  
Old December 7th, 2006, 07:43 PM posted to microsoft.public.access.reports
Access Africa
external usenet poster
 
Posts: 13
Default One Report two parameters


When you say that it has to have its value set , does it mean that it can
not be an unbound?


"Marshall Barton" wrote:

Access Africa wrote:

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

[...]
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.

--
Marsh
MVP [MS Access]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.