QUES: Parameterized Query

I'm trying to implement a master/detail relationship in a human
resources application between two Paradox tables, of which one
has a compound key. The EMP_NO field is used throughout the
application, but the PROMTRAN table also uses a
self-incrementing field (since each employee may have more than
one promotion or transfer) in conjunction with the EMP_NO field
as key. When I try to connect PROMTRAN to EMP_PERS (master
table) through EMP_NO (using the Object Inspector), Delphi
complains that it can't access PT_NO. Is there a way to do this?

Failing this, I tried dropping a TQuery, QueryPromTrans, on the
form. There was already a tblPROMTRANS and a dsPROMTRANS on the
form. I pointed the query's datasource to dsPROMTRANS. The SQL
property holds:

SELECT PROM_TO, PROM_DATE, TRANS_TO, TRANS_DATE,
HRLY_RATE FROM PROMTRAN
WHERE EMP_NO = :EMPLOYEENUM

I used the Fields Editor to define the desired fields in the
grid that I want updated with these values, and the Params
property of the query contains EMPLOYEENUM as Integer. The code
used to call the query is as follows:

procedure TForm1.DBEditEmpNoChange(Sender: TObject);
begin
  {The following section accounts for salaried and other
  employees who began as hourly and who were promoted to
  salaried or otherwise removed from hourly status.}
  tblHourins.open;
  if not (tblHourins.findkey([dbEditEmpNo.text])) then
    begin
      DBEditHMedical.text := '';
      DBEditHDental.text := '';
      DBEditHOptLife.text := '';
      DBEditHDepLife.text := '';
      DBEditHHmo.text := '';
      DBEditHSalary.text := '';
    end;

  QueryPromTrans.close;
  QueryPromTrans.prepare;
  QueryPromTrans.Params[0].AsInteger := Strtoint(dbEditEmpNo.text);
  QueryPromTrans.open;
end;

This is called whenever the cursor into the EMP_PERS table
changes, as indicated by a change in the EMP_NO field displayed
in dbEditEmpNo memo box. Never happens. The dbGrid (datasource:
dsPROMTRANS) never displays any information. At all. Nada. Zip.
No errors are generated, so I assume the BDE isn't having any
problems with the above.

I would appreciate any help anyone might be able to give.
Because of the volume of traffic here I'm afraid that I
might miss a post. If you would be so kind as to e-mail, I will
be happy to summarize responses and post here. TYIA.

Scott

... "42? 7 and a half million years and all you can come up with is 42?!"
___ Blue Wave/QWK v2.12