G
Gina
Hello All!
I have a dialog box from which I print reports. I want to
pass values entered on the dialog form to my reports. It
works when I print directly from the dialog form, but when
I go to print preview first I lose my values.
Here's a portion of my code:
Visible=False
If (ReptToPrint = 2) Then
DoCmd.OpenReport "rptEventsByEE", acPreview, "", Eval("IIf
([Forms]![frmPrintReports]![cboEvents] Is Null,""[Date]
Between Forms![frmPrintReports]![txtBegDate] and Forms!
[frmPrintReports]![txtEndDate]"",""[EmployeeName]= Forms!
[frmPrintReports]![cboEvents]and [Date]Between Forms!
[frmPrintReports]![txtBegDate] and Forms![frmPrintReports]!
[txtEndDate]"")")
End If
DoCmd.Close acForm, "frmPrintReports"
I guess the reason it doesn't work when I print preview
and then print (from the print icon) is because the print
dialog box is closed in the code. (The values show up in
print preview, but when I print the hard copy I get the
#Name? error.)
Hopefully I've made myself clear...can someone help me
modify my code (or write new code) to leave the print
dialog box open long enough for me to print a hard copy
from print preview? I'm rather new at this...I still
can't believe I can write any code at all!
Thanks so much.
I have a dialog box from which I print reports. I want to
pass values entered on the dialog form to my reports. It
works when I print directly from the dialog form, but when
I go to print preview first I lose my values.
Here's a portion of my code:
Visible=False
If (ReptToPrint = 2) Then
DoCmd.OpenReport "rptEventsByEE", acPreview, "", Eval("IIf
([Forms]![frmPrintReports]![cboEvents] Is Null,""[Date]
Between Forms![frmPrintReports]![txtBegDate] and Forms!
[frmPrintReports]![txtEndDate]"",""[EmployeeName]= Forms!
[frmPrintReports]![cboEvents]and [Date]Between Forms!
[frmPrintReports]![txtBegDate] and Forms![frmPrintReports]!
[txtEndDate]"")")
End If
DoCmd.Close acForm, "frmPrintReports"
I guess the reason it doesn't work when I print preview
and then print (from the print icon) is because the print
dialog box is closed in the code. (The values show up in
print preview, but when I print the hard copy I get the
#Name? error.)
Hopefully I've made myself clear...can someone help me
modify my code (or write new code) to leave the print
dialog box open long enough for me to print a hard copy
from print preview? I'm rather new at this...I still
can't believe I can write any code at all!
Thanks so much.