Report parameters can this work?

C

Casey

Is this possible using Access 2000 or am I using the wrong methods. I need
to produce the same report from several forms dependant on the individual
forms active record, the report is based on one record identified by the
field JobID. The report is based on a parameter query. Rather than changing
the reports record source. Can the following code be modified to prevent the
report query promting for the parameter even if I supply it as in the code
below.

Sub WkshtPrint(pJobID)
On Error .........

Dim cat As New ADOX.Catalog
Dim cmd As New ADODB.Command
Const strDocName as String = "rptWorksheet"
Const strMessage as string = "......."
cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Procedures("qryWorksheet").Command
cmd.Parameters(0) = pJobID
strEadd = DLookup("DefaultEmail", "tblSuppliers", "SupplierID = " &
SuppID)
DoCmd.SendObject acSendReport, strDocName, acFormatRTF, strEadd, , ,
"Work Instruction", strMessage
DoCmd.Close acReport, strDocName

Error Handling ............................
End Sub
 

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