I'm developing an Application that confronts two person e their born dates and, to do this, i have two ComboBoxes for the names that i get in a name field's table e to a MaskEdit that receives it's Born Date.
 
I'm doing this :
// to put tha names available in the database in the comboboxes :
 
procedure TFrmAfinidades.FormActivate(Sender: TObject);
  begin
    TblPersons.Active := True;
    TblPersons.Active := True;
    TblPersons.Open;
    TblPersons.First;
    While not TblPersons.eof do
      begin
        Combo_FirstName.Items.Add(TblPersonsName.Value);
        Combo_SecondName.Items.Add(TblPersonsName.Value);
        TblPersons.Next;
      end;
  end;
 
My intention is, when the Combo_FirstName changes to a name, the corresponding Born_Date's field have to fill the MaskEdit_BornDate1 and when the Combo_SecondName changes to a name, the corresponding Born_Date's field have to fill the MaskEdit_BordDate2.
 
i have tried to do many things like :
 
1 - Combo_FirstName.OnExit or Combo_FirstName.Onchange :
 
     MaskEdit_BornDate1.Text := DateToStr(TblPersonsBornDate.Value);

2 - Combo_SecondName.OnExit or Combo_SecondName.Onchange :
 
     MaskEdit_BornDate2.Text := DateToStr(TblPersonsBornDate.Value);
 
But what is going wrong ???? The BornDate everytime is the BornDate of the last record.
 
TIA
 
JALT
 
 

Reply via email to