elGringo Posted November 24, 2016 Share Posted November 24, 2016 Having in MainForm procedure TMainForm.UniFormCreate(Sender: TObject); begin FGenerateUniqueCode:=TGenerateUniqueCode.Create(Self); end; in other module procedure TGenerateUniqueCode.DataModuleCreate(Sender: TObject); begin // if (Sender is TMainForm) then begin MainForm_UnitVar:=(Sender as TMainForm); qSelectAllCodes.Connection:=MainForm_UnitVar.DBConnection.FDConnection; qInsertNewCode.Connection:=MainForm_UnitVar.DBConnection.FDConnection; end; end; How to give correct link to TMainForm? On Debug it acts like it doesn' see it, but in TMainForm.UniFormCreate i give link to Self... Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.