DriveSoft wrote:

Check it out


procedure frmRentalAdd_ComboBox1_OnChange (Sender: string);
var
    s: string;
begin
    s := SQLExecute ('SELECT productdate FROM allequipmentdb WHERE id = ' + frmRentalAdd.ComboBox1.sqlValue );
    if s <> '' then frmRentalAdd.DateTimePicker1.DateTime := SQLDateTimetoDateTime(s) else frmRentalAdd.DateTimePicker1.Checked := False;
end;

But it's not right way.
I can recommend for you to read about database structure (database normalization)
http://myvisualdatabase.com/forum/viewtopic.php?id=986

Thank you for your help admin, yes it's my mistake

DriveSoft wrote:

Something wrong in your logic database.

      SELECT testdate FROM rentaleqdb WHERE id = ' + frmRentalAdd.ComboBox1.sqlValue

frmRentalAdd.ComboBox1.sqlValue contain ID from allequipmentdb database table, but you try to use it for rentaleqdb.id, it's just mistake.


Unfortunately I can't understand what exactly you want to do.


при выборе оборудования в графе Search model Name, возможно ли автозаполнения граф Date, Model Name и Company name  из базы данных ?

http://s018.radikal.ru/i516/1711/82/0d8167c73b94.jpg

DriveSoft wrote:

Please attach your project.


Attach my project

DriveSoft wrote:

Hello.


procedure frmRentalAdd_ComboBox1_OnChange (Sender: string);
begin
      frmRentalAdd.DateTimePicker1.DateTime := SQLDateTimeToDateTime (SQLExecute ('SELECT testdate FROM rentaleqdb WHERE id = ' + frmRentalAdd.ComboBox1.sqlValue ) );
end;

Same problem occurs again

Hi,  how to get date from another form date and store it in datetimepicker?


procedure frmRentalAdd_ComboBox1_OnChange (Sender: string);
begin
 
     frmRentalAdd.DateTimePicker1.DateTime := StrToDate (SQLExecute ('SELECT testdate FROM rentaleqdb WHERE id = ' + (frmRentalAdd.ComboBox1.dbItemID) ) );

end;

http://s019.radikal.ru/i605/1711/be/05b21fe6fb3a.jpg