I've make the adjustments you're recommended and changed the report properties to popup = no, modal = yes.
I continue to get only the report's window bar as shown here:
The code that opens the window:
Code:
Private Sub cmdPrint_Click()
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
'
'=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
strRptRecSrc = Me.RecordSource 'RecordSource for report changes as we change
strRptFilter = Me.Filter
strRptSort = SortColumn
On Error GoTo Err_Handler
'hide form & open report in report view
DoCmd.Minimize
DoCmd.OpenReport "rptDirectory", acViewReport, , , acDialog
Exit_Handler:
Exit Sub
Err_Handler:
strProc = "cmdReportView_Click"
MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
Resume Exit_Handler
End Sub
And, the Open & Load code in the report's module:
Code:
Option Compare Database
Option Explicit
Dim strAppendage As String
Dim strProc As String
Private Sub Report_Open(Cancel As Integer)
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
' strRptSort is a global variable that is set by frmRegistry and frmPrintOptions
' depending on conditions chosen by the user. The OPEN code here simply adjusts
' the report title section in keeping with and the setting of the sort order.
'*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
On Error GoTo Err_Handler
Me.lblHeader.Caption = strRptTitle
Select Case strRptSort
Case "lblLastName"
strAppendage = "Last Name"
Me.OrderBy = "LastName"
Case "lblFirstName"
strAppendage = "First Name"
Me.OrderBy = "FirstName"
Case "lblUnit"
strAppendage = "Apartment numbers"
Me.OrderBy = "Unit"
Case "lblExt"
strAppendage = "Telephone Extensions"
Case "lblCell"
strAppendage = "Cell numbers"
Me.OrderBy = "Cell"
Case "lblLandLine"
strAppendage = "Landline numbers"
Me.OrderBy = "Landline"
Case "lblEMA"
strAppendage = "Email Addresses"
Me.OrderBy = "EMA"
End Select
Me.RecordSource = strRptRecSrc
Me.Filter = strRptFilter
Me.FilterOn = True
Me.OrderByOn = True
Me.lblSortedBy.Caption = "Listing Sorted by " & strAppendage
Exit_Handler:
Exit Sub
Err_Handler:
strProc = "Report_Open"
MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
Resume Exit_Handler
End Sub
Private Sub Report_Load()
On Error GoTo Err_Handler
'Show & maximize ribbon
ShowRibbon
If IsRibbonMinimized = True Then ToggleRibbonState
ShowRibbon
Exit_Handler:
Exit Sub
Err_Handler:
strProc = "Report_Load"
MsgBox "Error " & Err.Number & " in " & strProc & " procedure : " & Err.description
Resume Exit_Handler
End Sub