I've been trying to create a lookupfield in a grid for hours, and it works in design mode but when I run the program, I always got the error"Can not perform opration on an inactive dataset". I have searched online and in the forum and can see that more people have the same problem. I have not been able to find a solution online. I then tried to do a test in Delphi6 just as in Lazarus here an error occurred when I defined new lookupfield in design mode with ZQueryXX set to active = true if active = false then ok. I then do the test in Lazarus by setting ZQueryXX to false before "RUN" and put in my case ZQuery1.active = true and ZTable1.active = true in the FormCreate method. Then the lookupfield in the grid was ok. (Lazarus 1.6.4 and 1.8RC4)I hope this can be used by other in the forum.Thank you for all the help that can be found here.

Yes no problem. J have made a small example for test in a zip-file.J use MySql as database and have export the example data in af file named "test.sql"There is also a Word file "info" with screen cuts. Hope you can use it.

See the attached file, it's working! On ZConnection1 write the full path to your db (or browse it).The solution was close all connections in desing mode, then on the FormCreate event first open Zconnection1 , Zquery2, Zquery1 in this order: