Hi all

I have a small program which, depending on the parameters passed,
automaticaly creates and prints different reports. It is accessing an SQL
database.
The program is executed from another program or an a shortcut I have created
with the appropriate parameters.

If I run the program manually, a form appears for the parameters required, I
press a button and a Quickreport report is previewed or printed and the
report is fine. The problem is that when run via the shortcut everything is
fine except that it is failing a key lookup of another SQL table, saying it
can't find the record, which is stupid as running manually its fine passing
though the exact same code.

The code is below. This is performed on a SUBDETAILBEFOREPRINT method

               Saleno := DataModule1.WLSMDSale_no.Value;
               DataModule1.MasterTable.Setkey;
               DataModule1.MasterTableSale_No.Value := Saleno;

               Showmessage(DataModule1.MasterTable.Indexname + ' ' +
floattostr(DataModule1.MasterTableSale_No.Value));

               If DataModule1.MasterTable.GotoKey then   :: this gotokey
fails on the automatic run
                  QRDest.Caption := QRDest.Caption +
DataModule1.CustLname.Value
               else
                  Showmessage('Not Found');

The italics showmessage displays the correct information when running both
ways.

Any ideas please

Eion McIntosh
PPCS Ltd





#####################################################################################
This e-mail message has been scanned for Viruses and Content 
#####################################################################################
---------------------------------------------------------------------------
    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/

Reply via email to