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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Close a report, closes whole database in MS 2003

Status
Not open for further replies.

jadedinvasion

Programmer
Feb 8, 2005
22
CA
In the Database i'm working on, users are able to run several reports. But when the reports are run, they automatically close the database once the report has been printed off. I have tried different options in the docmd.openreport call (i.e. acViewPreview, acViewNormal) I get the same results when the report is closed. I have even tried changing the window mode, but still does the same thing.

Is there a way to get around this?

Thanks,

- Jaded
 
Nothing huge, just some flag sets for visibility on the report it's self

[blue]Option Compare Database
Option Explicit
Dim flag

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If flag = True Then
If DeficientAux = "X" Then
Me.Section(acDetail).Visible = True
Else
Me.Section(acDetail).Visible = False
End If
End If
End Sub

Private Sub Report_NoData(Cancel As Integer)
[green] 'MsgBox "No Data Available... The Report is empty..."[/green]
flag = False
End Sub

Private Sub Report_Open(Cancel As Integer)
flag = True
End Sub
[/blue]

There is however, an odd section of code that is supposedly called when the report closes: [purple] (this code is from the click event on a listbox)[/purple]

[green]'Waits until it's closed[/green]
[blue] While SysCmd(acSysCmdGetObjectState, acReport, Repor_names.Column(4)) <> 0
DoEvents
Wend
Call hide_window(hWndAccessApp, 0)[/blue][green] 'this is a user defined function that hides a certain window [/green]
[blue] me.visible = True[/blue]

Should I try putting a mainmenu.visible = true in the close event on the report and just comment out the code that waits for the report to close?
 
I'm not exactly sure what that is supposed to do, but i would try commenting out the line:

Call hide_window(hWndAccessApp, 0)

-Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top