Window Priorities a small Problem (1 Viewer)

modex

New member
Local time
Today, 07:03
Joined
Apr 5, 2001
Messages
6
Hi

A little problem I hope someone could help me with please.

I have a Dialog form which after a couple of parameters have been set and a click of a button, will open up a Print Preview Screen. The problem is, the Print Preview screen sits behind the dialog box and I have to close the dialog form to get at print preview screen to view and close it. Does anyone have any ideas on how I can bring the Print preview to the forefront of the screen.

I did try closing the dialog box and then reloading it on the "on close" action of the print preview, this opened the dialog form ok, but did not close the the print preview.

Very frustrated
ModeX
 

Rich@ITTC

Registered User.
Local time
Today, 07:03
Joined
Jul 13, 2000
Messages
237
Hi Modex

Presumably your dialogue box is a popup form (perhaps even a popup modal form).

Assuming you want the form to completely disappear when you go to the Print Preview you would need to add some coding to the button you click on your dialogue form to open the report in Print preview. This command button will now also close your dialogue form.

-------------------------------------------
Sub cmdYourReport_Click()

On Error GoTo Err_cmdYourReport_Click

Dim strDocName As String
Dim strLinkCriteria As String

strDocName = "rptYourReport"
strLinkCriteria = "[ClientID] = Forms![frmClient]![ClientID]"

DoCmd. Close

DoCmd.OpenReport strDocName, acPreview, , strLinkCriteria

Exit_cmdYourReport_Click:
Exit Sub

Err_cmdYourReport_Click:
MsgBox Err.Description
Resume Exit_cmdYourReport_Click

End Sub
---------------------------------------
The extra piece of coding added to the normal opening-a-report coding is the DoCmd.Close section, which needs to be added before you then go on to open up the report.

(It probably goes without saying but you need to substitute the actual name of your report where I have used "YourReport" in the coding).

If you want the dialogue form to remain open, floating on your screen on top of the report preview but allowing the report to be printed, closed etc then set the Modal setting on the dialogue form to "No".

HTH

Rich Gorvin


[This message has been edited by Rich@ITTC (edited 04-20-2001).]
 

Users who are viewing this thread

Top Bottom