Using DataModules query lazarus / 16-Databases ---------------------------------------------------------------------- daveinhull · 2019-02-21 01:29 Hi, I've been working on a program and the number of non-visible objects has grown to a point that I thought I had bettr start using DataModules. So I moved all the non-visible objects into a Data modules (DataModule1) and add the 'uses' reference to my main form. I then went through and referenced all the uses with DataModule1. prefex (Know I should seperate the uses better between the main form and the datamodule, but for now I just wanted to try it this way), e.g. DataModule1.Connection1.Connected := True etc. However, when I run the program, the references to DataModule1 are all zero and it crashes. Have I forgot to do something, like initialise the the datamodule? Thanks Dave ---------------------------------------------------------------------- dsyrios · 2019-02-21 04:02 Maybe, you have to see this? http://forum.lazarus.freepascal.org/index.php?topic=41408.0 ---------------------------------------------------------------------- daveinhull · 2019-02-27 13:21 Thanks dsyrios, I'll give that a read.