A
Amit
MS Access 2000, Windows XP
======================
Hi,
I have a simple form with a "Print Report" button on it, which I created
using the Command Button wizard. I've modified the code behind the button
somewhat. The code is:
==============================================
Dim stDocName As String
Dim stWhere As String
stDocName = "rptData"
stWhere = "[qselData]![UniqueID] =" & Me.UniqueID
DoCmd.OpenReport stDocName, acPreview, , stWhere
DoEvents
DoCmd.RunCommand (acCmdPrint)
===============================================
What I'm trying to achieve is have the report open and display data for the
current record on the form (instead of all the records in the table), and
then have the Print Window automatically pop up without the user having to go
to "File--> Print". This is all working fine, except for a minor glitch.
I had to use DoEvents because without it, the data on the Report behind the
Print Window (where you specify the printer, number of copies etc.) was
coming up as blank, and the data got displayed only when the Print Window
closed.
But, if I move the Print Window around, the area behind it in the Report
shows up as blank, and only the text around the Print Window is visible (that
was not hidden by the Print Window).
Is this a normal behavior of Access?
Is there a way to have the data in the Report be displayed properly while
the Print Window is open and moved around?
The entire data becomes visible when the Print Window is closed.
I've tried using Docmd.RepaintObject <reportname> but that didn't achieve
the desired result.
Any suggestions or ideas?
Thanks.
-Amit
======================
Hi,
I have a simple form with a "Print Report" button on it, which I created
using the Command Button wizard. I've modified the code behind the button
somewhat. The code is:
==============================================
Dim stDocName As String
Dim stWhere As String
stDocName = "rptData"
stWhere = "[qselData]![UniqueID] =" & Me.UniqueID
DoCmd.OpenReport stDocName, acPreview, , stWhere
DoEvents
DoCmd.RunCommand (acCmdPrint)
===============================================
What I'm trying to achieve is have the report open and display data for the
current record on the form (instead of all the records in the table), and
then have the Print Window automatically pop up without the user having to go
to "File--> Print". This is all working fine, except for a minor glitch.
I had to use DoEvents because without it, the data on the Report behind the
Print Window (where you specify the printer, number of copies etc.) was
coming up as blank, and the data got displayed only when the Print Window
closed.
But, if I move the Print Window around, the area behind it in the Report
shows up as blank, and only the text around the Print Window is visible (that
was not hidden by the Print Window).
Is this a normal behavior of Access?
Is there a way to have the data in the Report be displayed properly while
the Print Window is open and moved around?
The entire data becomes visible when the Print Window is closed.
I've tried using Docmd.RepaintObject <reportname> but that didn't achieve
the desired result.
Any suggestions or ideas?
Thanks.
-Amit