Please! Please! Help!

G

Guest

Hi
I have this Report that I draged a "Query" in to it. I need to have i
to open by "Response report number" that is in the "Query" and th
Query name is "qryOutsideResponses" and the Query field i
"ResReportNumber
This code opens the first report. The Report can have one to three
out side responses - (Police Dept., Fire Dept., and Paramedic
As long as it will find a match number with the "Response" in tha
field it will be fine
What do I need to do? Please help

Thank you


Private Sub PrintByPoliceReport__Click(
On Error GoTo Err_PrintByPoliceReport__Clic
-----------------------------------------------------------------------------
Dim stDocName As Strin
Dim intUserRespond As Intege
Dim strResReportNumber As Strin
Dim strWhere As Strin
Dim cancel As Intege
If Me.Dirty Then 'save any edit
Me.Dirty = Fals
Els
strResReportNumber = InputBox("Please enter the Police Repor
Number you wish to print", "View BPL by Respond Report Number"
If IsNumeric(strResReportNumber) = False The
Exit Su
Els
strResReportNumber = CInt(strResReportNumber

strWhere = "[ResReportNumber] = """ & strResReportNumber
"""
stDocName = "rptMasterBPLReport
DoCmd.OpenReport stDocName, acViewPreview, , strWher
DoCmd.RunCommand acCmdZoom10
intUserRespond = MsgBox("Do you want to print this report?"
vbOKCancel, "Print Report Window"
If intUserRespond = vbOK The
cancel = Tru
DoCmd.OpenReport acPrintAll, acViewPrevie
Els
DoCmd.Clos
End I
End I
'End I
Exit_PrintByPoliceReport__Click
Exit Su

Err_PrintByPoliceReport__Click
MsgBox Err.Descriptio
Resume Exit_PrintByPoliceReport__Clic

End Sub
 
B

Bruce

I can't make out what you have done, or what you are
asking. You will need to provide details such as on what
data you are trying to report, why you dragged a query
into a report (which is rather a curious thing to do on
the face of it), and anything else that could explain your
intentions. Do you intend to use the query to restrict
the report to a single record?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top