How do I display report on top of forms

  • Thread starter Thread starter John
  • Start date Start date
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
 
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
 
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
 
Back
Top