Skip to forum content
My Visual Database
A Simple Solution for Creating Databases
You are not logged in. Please login or register.
Active topics Unanswered topics
Search options
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 из базы данных ?
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;
Posts found: 5