DoCmd.PrintOut problem

radek225

Registered User.
Local time
Today, 15:35
Joined
Apr 4, 2013
Messages
307
I have a report with 4 subreports.
Ms Access doesn't print this report, without any error. I know that problem is subreport where data are form query (when I delete this subreport, everything is ok). Someone know why is that?
 
radek,

The problem is probably that the query that feeds your reports has inner joins.

Get the query in design view.

Right-click on the lines joining tables and change the join-type to 2.

Test it with the query. Then run your report.

hth,
Wayne
 
changed but still doesn't work. don't get it. In report view everything looks fine :/
 
What type of error do you get, (error number, error message)?
 
don't get any error.
Code:
Private Sub Polecenie89_Click()
On Error GoTo Err_Polecenie89_Click
Me.DataPrzyjecia.SetFocus
Me.Polecenie89.Visible = False
DoCmd.PrintOut
DoCmd.Close acReport, Me.Name

Exit Sub
Err_Polecenie89_Click:
    MsgBox err.Description
End Sub

Ms Access show description that
first page is printing
second page is printing
and where should be info that third page is printing (form with data from query) printing description disappears, report isn't closed - but with my code should be.
And that's all:/
 
Do you have the code running in a form or in a report, (it isn't clear for me)?
What is DataPrzyjecia and why do you set focus on it?
What is Polecenie89 and why do you hide it?
... and where should be info that third page is printing (form with data from query) printing description disappears, report isn't ...
Is the above a subform or a subreport, (you write form but it could be a typo, else are you mixing reports and forms?)?
What happen if you choose printing from the menu line instead of using you code?
Could you post a stripped version of your database with some sample data, (zip it)?
 
Last edited:
Do you have the code running in a form or in a report, (it isn't clear for me)?
in a report. It is button to print report. So You can open report and then if you want print it.
What is DataPrzyjecia and why do you set focus on it?
What is Polecenie89 and why do you hide it?
I need to move the focus somewhere, because I do not want this button "polecenie89" to print. "Polecenie89" it's print button
Is the above a subform or a subreport, (you write form but it could be a typo, else are you mixing reports and forms?)?
This is a subreport that was created on the basis of the subform. The subform source is query - and that's the problem (I think)
What happen if you choose printing from the menu line instead of using you code?
Could you post a stripped version of your database with some sample data, (zip it)?
Now I don't have an access to my database, but of course as soon as I had it turning on a sample file (tomorrow)
 
ok, I solved the problem.

In subreport "has module", was "yes" should be "no" that's it. :D:D:D.
Thanks for the insight guys!
 

Users who are viewing this thread

Back
Top Bottom