Print view goes behind the forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I am new to Access.

I have a print button on this form. Here is the expression for that:

DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"


What happens is that the view go behind the opened forms and I have to close
the forms to get to it.

What I want is for the print view to come to the front and when I close it I
want to still be on the form.

Please help

Thank You alot.....
 
The report should come to the front unless:
a) it is already open, or
b) your forms are open as popup forms, or in dialog mode.

Solving (a) will be a matter of closing it if it's already open:
If CurrentProject.AllReports("rptTravel").IsLoaded Then
DoCmd.Close acReport "rptTravel"
End If

In Access 2002 or later, you could get around (b) by opening it in dialog
mode. But the better solution would be to open the forms in normal mode.
They will then become visible again once the report closes.

If you really want popup mode for your forms, another alternative would be
to run code in the Open event procedure of the report to hide the forms, and
run more code in the Close event of the report to show the forms again.
 
What you are seeing is caused by your form being PopUp. Make the form
invisible while you are viewing the preview and then set visible true when
exiting the report preview.
Hi I am new to Access.

I have a print button on this form. Here is the expression for that:

DoCmd.OpenReport "rptTravel", acViewPreview, , "[SSN] = '" & [SSN] & "'"

What happens is that the view go behind the opened forms and I have to close
the forms to get to it.

What I want is for the print view to come to the front and when I close it I
want to still be on the form.

Please help

Thank You alot.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top