How do I display report on top of forms

J

John

I have two databases and have a command button set to preview reports in
each database.
When I click the preview button, the report will display over the form in
one database, but behind the form in the other. I want the report to appear
on top with the form behind. I cannot find the setting which decides this.

Any help on this greatly appreciated

Thanks

John
PS. code attached to command button.

Private Sub cmdPreviewInvoice_Click()
On Error GoTo Err_cmdPreviewInvoice_Click

Dim strDocName As String

strDocName = "rptInvoice"
DoCmd.OpenReport strDocName, acPreview, , "[InvoiceNumber] = " &
Me!InvoiceNumber

Exit_cmdPreviewInvoice_Click:
Exit Sub

Err_cmdPreviewInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewInvoice_Click

End Sub
 
L

Larry Linson

The only time I have had a situation similar to what you describe is when
the Forms were dialogs or popups. If you change the Form properties so that
it is a "normal" form, the problem may disappear. If not, follow up by
posting back here.

Larry Linson
Microsoft Access MVP
 
J

John

That was the problem ok, Thanks for your help

John


Larry Linson said:
The only time I have had a situation similar to what you describe is when
the Forms were dialogs or popups. If you change the Form properties so
that
it is a "normal" form, the problem may disappear. If not, follow up by
posting back here.

Larry Linson
Microsoft Access MVP

John said:
I have two databases and have a command button set to preview reports in
each database.
When I click the preview button, the report will display over the form in
one database, but behind the form in the other. I want the report to appear
on top with the form behind. I cannot find the setting which decides
this.

Any help on this greatly appreciated

Thanks

John
PS. code attached to command button.

Private Sub cmdPreviewInvoice_Click()
On Error GoTo Err_cmdPreviewInvoice_Click

Dim strDocName As String

strDocName = "rptInvoice"
DoCmd.OpenReport strDocName, acPreview, , "[InvoiceNumber] = " &
Me!InvoiceNumber

Exit_cmdPreviewInvoice_Click:
Exit Sub

Err_cmdPreviewInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewInvoice_Click

End Sub
 

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

Top