Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible for one report to based on different reports?

Status
Not open for further replies.

hshaker

Technical User
Jun 29, 2007
66
CA
Hi there,

Is it possible for one report to be based on several queries?

Suppose that you want to use the same report but want to filter the records based on what button the user clicks on?

Thanks.

 
Look at the arguments for OpenReport. The fourth is Where.
 
Hi there,

I do not know what is wrong with this "where clause"

Private Sub cmdEWOByProcessStep_Click()
On Error GoTo Err_cmdEWOByProcessStep_Click

Dim stDocName As String

stDocName = "rptEWOReport"
DoCmd.OpenReport stDocName, acPreview, , (((tblEWO.ProcessStep) = [Forms]![frmEWOMenu]![cmbEWOProcessStep]))


Exit_cmdEWOByProcessStep_Click:
Exit Sub

Err_cmdEWOByProcessStep_Click:
MsgBox Err.Description
Resume Exit_cmdEWOByProcessStep_Click



Error says "Object required"
 
You need Where as a string:

[tt]stDocName = "rptEWOReport"
DoCmd.OpenReport stDocName, acPreview, , "ProcessStep = " &[Forms]![frmEWOMenu]![cmbEWOProcessStep][/tt]

If ProcessStep is a text field, you will need single quotes:

[tt]stDocName = "rptEWOReport"
DoCmd.OpenReport stDocName, acPreview, , "ProcessStep = '" &[Forms]![frmEWOMenu]![cmbEWOProcessStep] & "'"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top