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!

Close CRViewer object in VB App?

Status
Not open for further replies.

Jill50

Programmer
Apr 11, 2001
21
US
I have a VB app that includes 3 forms - 1 main form and 2 forms with CRViewer objects to display Crystal reports that have been added to the VB project as CrystalReport1 and CrystalReport2. The 2 command buttons on the main form launch the appropriate Crystal report and the Crystal parameter screen pops up and allows user parameter input and then the report comes up in the viewer correctly. All the code for this works fine (including passing the logon parameters to the SQL server) for both reports - the problem comes in when the report viewer is closed via the X in the upper right corner and the main menu is again displayed. If the command buttons are clicked on a second time the Crystal parameter screen does not appear to allow for new parameters to be entered. The form is being unloaded to return to the main menu - is there a way to also close the CRViewer object or to reset the recordsource property so that a new report can be launched without ending the entire VB project and restarting it? (The VB project is compiled and distributed as an .exe)
Thanks for any help!!
 
Sorry to waste anyone's time on this thread - I figured out the problem myself and it was simple. The variable named "report" needed to be set to nothing when the viewer form was unloaded. (I was trying to set the CRViewer's recordsource to nothing!)
Thanks anyway!
Jill50
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top