Hi Mary,
I tried adding duplex capability to the sample that Microsoft provides as a
download. In the process, I discovered a bug in their code for populating the
list box with the reports in the database. The list box in frmPrinter
displays 13 available reports. However, I count 14 reports total. The missing
report is "Summary of Sales by Year".
Close the form. Try importing a report from another database. Reopen the
form. All appears well, as you can see the report that you just imported in
the list box. Close the form again. Do a compact and repair of the database.
Reopen frmPrinter. Oops, why isn't the newly imported report showing up? At
least *now* I can see the "Summary of Sales by Year" report! My simple fix
for this problem is to change the method that is used to populate the list
box. Set the Row Source Type to a Table/Query, and set the Row Source to the
following query:
SELECT msysobjects.Name AS Reports
FROM msysobjects
WHERE (((msysobjects.Type)=-32764))
ORDER BY msysobjects.Name;
Comment out (or remove) the line of code in Form_Open that clears the
listbox, ie.:
' Clear lstSelectReport and cboPrinter lists
' before loading the current lists of reports
' and printers.
With Me
!cboPrinter.RowSource = ""
' !lstSelectReport.RowSource = ""
End With
Finally, remove the code that the author used in Form_Open to populate the
list box:
' Loop through reports and add each to
' lstSelectReport list box. This loops through the
' AllReports collection in inverse order instead
' of using a For Each...Next statement so
' that reports are listed in alphabetical order.
Me!lstSelectReport.RowSourceType = "Value List"
intCount = CurrentProject.AllReports.Count - 1
Do While intCount > 0
Me!lstSelectReport.AddItem _
CurrentProject.AllReports(intCount).Name
intCount = intCount - 1
Loop
On the duplex issue, after *many* trips to a shared network printer at work
that includes duplex capability, I've generated a lot of paper for the
recycle bin. I've only been able to get a report to print on both sides of a
single sheet of paper about 5~10 percent of the time. The other 90~95 %, the
darn report just prints out single sided. I was using a report that included
two pages, so that I'd know for sure if it printed as intended. Pretty
frustrating, to say the least.
Tom Wickerath
Microsoft Access MVP
http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________