Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with rpt preview screen

Status
Not open for further replies.

Amadea

Technical User
Oct 11, 2003
49
US
Hope this is the correct forum for this question. All the forms in my database or set to be popup. About three forms deep I've set the "Print Report" button to preview the report before the user chooses to print the report, however, the preview opens underneath all the forms.

Why does it do that? Or, can I set something so the report preview opens on top of all the open forms?

Thanks for any advice.
Amadea
 
The report opens behind the form(s) because they are popups, and as long as they are, I think you can't open a report "over them", except I think starting with the xp (2002) version you can also open reports as popups:

[tt]docmd.openreport "myrpt",acviewpreview,,,acdialog[/tt]

- which will open the report "over" the form (don't use this, but I think you'll miss the toolbar, and need to right click to print...)

Else the "normal" workaraound is hiding the forms when opening the report, then make them visible again when closing the report.

Roy-Vidar
 
You must cycle through each form and hide them. When the report closes, recycle and display them. Also, put the command DoCmd.Maximize (the report) Although, .Maximize doesn't react in Access 2000, but works well in Access XP. I do this all the time.
 
Thank you very much for the information. I've looked through the FAQs and searched other forums without luck in finding the howto. So, I have to ask.

Now, the DoCmd.Minimize and .Maximize have no arguments, therefore, how do I specify the forms to minimize/maximize?
Below is my code to preview the report. I think I need to include this so that the user can be sure they are getting what they asked for since they are selecting options for the WHERE condition. Currently, the report preview is opening beneath three open forms.

Thanks for your input.
Amadea

Code:
Private Sub cmdPreviewRpt_Click()
On Error GoTo Err_cmdPreviewRpt_Click

    Dim strWhere As String

    If Me.fmeChooseRpt = 1 Then
        strWhere = " AND DivNum = '" & Me!DivNum & "'"
    ElseIf Me.fmeChooseRpt = 3 Then
        strWhere = " AND BldgNameFull = '" & Me!cboBldg2 & "' "
    End If
    
    If Me.fmeType = 2 Then
        strWhere = strWhere & " AND Category = '" & Me!cboPrintType & "' "
    End If
    
    If Me.fmeSeats = 2 Then
        strWhere = strWhere & " AND MaxSeats Between " & Me!txtMinSeats & " AND " & Me!txtMaxSeats & " "
    End If
    
    If Me.fmeDetail = 1 Then
            DoCmd.OpenReport "rptRoomsWO", acViewPreview, WhereCondition:=Mid(strWhere, 6)
    ElseIf Me.fmeDetail = 2 Then
            DoCmd.OpenReport "rptRoomsW", acViewPreview, WhereCondition:=Mid(strWhere, 6)
    End If
    
Exit_cmdPreviewRpt_Click:
    Exit Sub

Err_cmdPreviewRpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdPreviewRpt_Click
    
End Sub
 
Thanks guys for your input. I think that because I hide the Access window, I cannot minimize the opening form so I'm going to have to abandon the thought of previewing the report.

Now I have another problem/dilemma. But I think that belongs on the forms forum, so I'll ask there.

Thanks for your time.
Amadea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top