I didn't try and debug the code, but logically here is what I believe will work.
1. Based on the criteria or selection in a field set a flag that is for multiple copies. So If I must have 2 copies set flag to true, if not set flag to false.
2. have a button to click that will run the report.
3. in the on click event for that button, set up an if statement to check the flag. If the flag is false it sets the footer flag to 1 and prints one copy. If the flag is true then it does a for next loop.
If the Counter in the for next loop is < 2 it sets the footer flag to 1 and prints the report, then it loops back up to beginning and adds one to counter, sets Footer flag to 2 and prints report again.
then it ends the for next loop.
4. in the report design, click on the bar that says "Page Footer" then go into the code window and add an if statement for the Footer flag. If the footer flag is 1 then show these controls, or set these control values etc. if it is 2 then set it to something different.
**Code for the On click event of the Print button.
**Threw this together quickly, may need debuging.
Sub Command_PrintReport_Click ()
'Set the multi copy flag
if Forms!MyForm!txt_copies = 1 then
MulticopyFlag = False
elsif forms!MyForm!txt_Copies = 2 then
MulticopyFlag = True
endif
'Check the flag and take appropriate action
FooterFlag = 0
if MultiCopyFlag = true the
For Counter = 1 to 2
FooterFlag = FooterFlag +1
Docmd.OpenReport "YourReportName"
Next Counter
Else
FooterFlag = 1
Docmd.OpenReport "YourReportName"
endif
MsgBox "Your Report is done",vbOkOnly,"Report Status"
end sub
** Code for the Page Footer on your report
If Forms!MyForm!FooterFlag = 1 then
Me.txt_CopyMesage.Value = "This copy for Customer"
Me.txt_ReturnPolicy.Visible = True
Me.lbl_CustomerSignature.Visible = True
Me.lbl_ProprietaryInfo.Visible = False
elseif Forms!MyForm!FooterFlag = 2 then
Me.txt_CopyMessage.Value = "This copy for Office"
Me.txt_ReturnPolisy.Visible = False
Me.lbl_CustomerSignature.Visible = True
Me.lbl_ProprietaryInfo.Visible = True
endif
If I'm not learning, I must be coasting. If I am coasting, I must be going down hill.