I have a detail table that I need to refresh independently of the master table; I’m using the close/open method.
If the master table is in dsEdit mode the detail table will not open, but the AfterOpen event is still called. This causes issues with any AfterOpen event handlers that (correctly) assume the table will be open.
There is a line in your code that says “If Master.State = dsBrowse” then … and it proceeds to open the table.
Either allow the table to be opened in dsEdit mode as well, or ensure that the after-open event isn’t called and there’s some warning to the developer…?
(mappingmode = mmWhere, detail and masteroptions are all default)
Delphi 10.1 Berlin