My task is to make a program by which a person can view student performance and attendance. DB did in Access, connected via ADOQuery (through it everything is done and necessary). I also use DBGrid. In the first DBGrid I have a college specialty, in the second group of college. And the problem is that I do not know how to make the connection between them! So that when you click on a specialty in the second DBGrid, it automatically shows the groups of this specialty (after that you will need to make a similar connection group - group students and students - attendance / performance). I know how to do this in ADOTable, but you can't use it, you need to use ADOQuery. I used this code
procedure TForm3.DBGrid1CellClick(Column: TColumn); begin with form2.ADOQuery2 do begin Close; SQL.Clear; SQL.Add('select * from groups where spec = "' + ADOQuery1.FieldByName('spec').AsString + '"'); Open; end; end; but the compiler constantly swears! Now he does not like quotes, then ADOQuery or ADOQuery1.FieldByName and AsString ... I will be grateful if you can help!