Hey People, so Im going to be blunt, I am a newbie programmer and have started building a school database. I have it all hooked up but my issue is the displaying of data. I know most of you are going to curse me for what I am about to show you but this was my friends request, as such no DBGrid for this project.
now as you can see, what he wants is the data to be inserted from the ADOTable into the data boxes so that they can be changed as needed.
this is the code currently
Now my issue is that the search function works once. It displays all the data, however when you search a second record it only changes the Student Name.
Now no matter how much I look I have no Idea how to search for information by row. Is there a way to make it search by row and not by individual field?
I realise my code is probably Horrific, And I will get better in time. if you have any recommendations I will take what I can get.
now as you can see, what he wants is the data to be inserted from the ADOTable into the data boxes so that they can be changed as needed.
this is the code currently
Code:
procedure TfSearch.BtnSearchClick(Sender: TObject);
begin
DBComboBox1.AutoComplete:= True;
ADOTable1.Open;
while not ADOTable1.Eof do
begin
if (ADOTable1['Student Name'] = DBComboBox1.Text)
then
begin
EdtName.Text := ADOTable1['Student Name'];
EdtSurname.Text:= ADOTable1['Surnames'];
EdtDate.Date := ADOTable1['Birthdate'] ;
EdtMobile.Text := ADOTable1['Mobile Number'];
EdtFixed.Text := ADOTable1['Fixed Number'];
EdtEmail.Text := ADOTable1['Email Address'];
EdtLevel.Text := ADOTable1['Student Level'];
EdtMomName.Text := ADOTable1['Mothers Name'];
EdtMomNum.Text := ADOTable1['Mothers Number'];
EdtDadName.Text := ADOTable1['Fathers Name'];
EdtDadNum.Text := ADOTable1['Fathers Number'];
EdtEmergency.Text := ADOTable1['Emergency Contact'];
end
else
ShowMessage('Student Not Found!');
Exit;
end;
end;
Now my issue is that the search function works once. It displays all the data, however when you search a second record it only changes the Student Name.
Now no matter how much I look I have no Idea how to search for information by row. Is there a way to make it search by row and not by individual field?
I realise my code is probably Horrific, And I will get better in time. if you have any recommendations I will take what I can get.