Ian Branch 127 Posted August 11, 2023 Hi Team, I am trying to assign the AfterEdit event to a TTable. I have this in the private area: procedure jtAfterEdit(Sender: TOBject); I have this in the DatamoduleCreate; JobTickets.AfterEdit := JTAfterEdit; And this as jtAfterEdit: procedure TdmC.JTAfterEdit(Sender: TOBject); begin // JobTickets.FieldByName('UserID').AsString := AUD.UserID; lNewRecord := False; // Specifically reset the flag. // end; Delphi tells me that "[dcc32 Error] dmCurrent.pas(861): E2010 Incompatible types: 'TDataSet' and 'TObject'" for this line: JobTickets.AfterEdit := JTAfterEdit; What have I missed pls? Regards & TIA, Ian Share this post Link to post
dummzeuch 1505 Posted August 11, 2023 Just going by the error message JTAfterEdit might need a parameter of type TDataset rather than TObject.. No idea whether that's correct, I haven't done any database programming for years. But also: Shouldn't JTAfterEdit be a method rather than a procedure? Share this post Link to post
Ian Branch 127 Posted August 11, 2023 Tks Thomas. Changing "Sender: TObject" to "Dataset: TDataset" did the trick. Regards & Tks again, Ian Share this post Link to post
Remy Lebeau 1394 Posted August 11, 2023 (edited) The signature of the event is documented: https://docwiki.embarcadero.com/Libraries/en/Data.DB.TDataSet.AfterEdit property AfterEdit: TDataSetNotifyEvent read FAfterEdit write FAfterEdit; https://docwiki.embarcadero.com/Libraries/en/Data.DB.TDataSetNotifyEvent TDataSetNotifyEvent = procedure(DataSet: TDataSet) of object; Edited August 11, 2023 by Remy Lebeau Share this post Link to post