Access enter a parameter prompt in access report/ vba

Joined
May 23, 2009
Messages
1
Reaction score
0
Hi i am using the below code to print a bunch of reports by filtering them from an array and as the code runs it asks me for the parameter value of each portfolio.. any idea how to stop that prompt? thanks in advance!

Sub PrintReport()

Dim rsPort As Variant

Dim strSQL As String

Dim i As Integer

strSQL = "SELECT Table1.PORTFOLIO FROM Table1 GROUP BY Table1.PORTFOLIO"

Set rsPort = CurrentDb.OpenRecordset(strSQL)

With rsPort

Do While Not .EOF

i = 0

DoCmd.OpenReport "MAIN_SHEET2", acViewPreview, "Qry_Main_Wght2", "PORTFOLIO =" & rsPort(i)

DoCmd.OutputTo acOutputReport, "MAIN_SHEET2", acFormatPDF, "V:\myDocuments\Reports\DailyClient\" & rsPort(i) & "\" & rsPort(i) & Format(Date, "yyyymmddhhss") & ".pdf"

DoCmd.Close acReport, "MAIN_SHEET2", acSaveYes


i = 1 + i


.MoveNext

Loop

End With

rsPort.Close



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