Challenge: Locating Records

In part of my program, I am trying to locate a record.  The main
customer form calls another form as ShowModal using the following code:

   CusIndex := DataModule1.Custab.IndexName;
   Schedule.InitialCust :=
   Schedule.IgnoreActivate := False;

When the schedule form is activated, the FormActivate event is called,
which containse the following code:

         DataModule1.Custab.Filtered := False;
         DataModule1.Custab.Filter := '';
         DataModule1.Custab.IndexName := 'LOCATION';

         IgnoreActivate := True;
         DataModule1.Custab.Locate('IDNUM', Integer(InitialCust), []);
         QueryFilter1.Checked := DataModule1.Custab.Filtered;

The problem is, no matter what I try, when the "Locate" line is called
from the FormActivate, I get the message:

         Project WINLTD.exe raised exception class EDBEngineError with
         message 'No current record'.  Process stopped. Use Step or Run
         to continue.

If anybody at all can help me, please send me an e-mail and/or post a
reply.  I really do appreciate any help you can give!!

Thanks in advance,

Wise Software, Programmer/Analyst