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!

access reports flash and disapear after mods??

Status
Not open for further replies.

pms18066

Programmer
Jan 12, 2005
94
US
I have recently made some changes to a report and now it wont stay open. I have a vb app which calls the report. Once the report is called it opens and closes very quickly. I have maximize statements to maximize the windows. It worked previously fine until I made some changes. I added a new filed to the underlying query and added a group to the report based on theis new field. In access the erport is dsiplayed and executes correctly. But from the VB app it just briefly flashes and the disappears right bfore the users eyes. Has anyone seen this before. Is there a certain flow I need to follow when changing queries and reports that use them?? If I go back to the pervious version of the database, no problems occure so it must have something to do with my changes.

Thanks
 
If the report works fine in Access, that would tell me that the problem is not with Access, but with the VB code.

Can you post the code used to call the report?
 
I use a generic call for the report that passes a report name only. The app is written in vb. I renamed the report and created a new one with the old name. The app now works correctly, Report stays open. I didn't have any code changes. There are 9 reports total. I changed 5 and all five had the smae issues.... I am lead to think that the process I used to modify the report and query must have been flawed or acess has a problem in changing a query that a report is already using. Seems like this should work though...

Ill post my code in a few....Just for kicks cuz I am sure the code is fine though...
 
Private Sub DoReport(rptName as string)

Dim objaccess As Object

On Error GoTo PrintAccessReport_ErrHandler
Set objaccess = CreateObject("Access.Application")

With objaccess
.OpenCurrentDatabase filepath:="C:\program
files\SIFManager\welchsif.mdb"
.DoCmd.OpenReport reportname:=rptname, View:=2
.Visible = True
.DoCmd.Maximize 'maximizes the Report window
.DoCmd.Maximize 'maximizes Access window
End With

Set objaccess = Nothing
 
Access goes nuts at times and is somewhat unpredictable when it comes to making changes. I have noticed several times when I try making changes to how code acts with objects, something would get corrupted and I would have to start over.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top