Hi guys,
I have a form and a button with a code to output a report. It works great.
Now I need to print that report for many record. I built a continuous form wich display those records.
Also I have a control box in each record where the user can enter data (references).
What I want to achieve is that :
for each row in that form where me.reference is not null,
output the report
I'm not good yet with "for each" codes
my output code
Thanks for yours suggestions
I have a form and a button with a code to output a report. It works great.
Now I need to print that report for many record. I built a continuous form wich display those records.
Also I have a control box in each record where the user can enter data (references).
What I want to achieve is that :
for each row in that form where me.reference is not null,
output the report
I'm not good yet with "for each" codes
my output code
Code:
sub outBtn()
dim FldrPath as string
dim FileName as string
dim FilePath as sting
FldrPath = "D:\Report"
FileName = "report_" & format(now,"yymmddhhmmss")
FilePath = fldrPath & "\" & Filename & ".pdf"
DoCmd.OpenReport "EtReport", acViewPreview, , "id_subact=" & Me.id_subact, acHidden
DoCmd.OutputTo acOutputReport, "EtReport", acFormatPDF, Filepath
DoCmd.Close acReport, "EtReport", acSaveNo
end sub
Thanks for yours suggestions