Mark, I think I have found your problem. You are using Quick Reports. Get a new report writer and you should be fine ;-).
Seriously tho the handling of QR1 looks strange to me. You aren't creating it so presumably it is automatically being created by PreviewFrm? However you do explicitly free QR1 (but you don't set it to nil). Is it possible that PreviewFrm then also tries to free QR1 causing an access violation because it has already been freed? David. > > > I have created a PreviewFm form and placed a TQuickRep component > (QR1) on this form. The AfterPreview event contains just a "Close" > statement. > > In my app I have the following procedure: > > procedure HandleViewReportsClick; //mh 2003-06-10 > begin > MainForm.OpenDialog.Filter := 'Report Files, *.qrp|*.QRP'; > MainForm.OpenDialog.Title := 'Select file to view'; > MainForm.OpenDialog.InitialDir := > ExtractFileDir(Application.ExeName); > > if MainForm.OpenDialog.Execute then try > Application.CreateForm(TPreviewFm, PreviewFm); > PreviewFm.QR1.Prepare; > try > PreviewFm.QR1.QRPrinter.Load(MainForm.OpenDialog.FileName); > PreviewFm.QR1.QRPrinter.Preview; > finally > PreviewFm.QR1.Free; > end; > finally > PreviewFm.free; > end > end; > > Any help greatly appreciated > > Mark > > ------------------------------------------------------------------ > --------- > New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] > Website: http://www.delphi.org.nz > To UnSub, send email to: [EMAIL PROTECTED] > with body of "unsubscribe delphi" > Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/ --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/