jahlxx Posted April 24, 2019 Share Posted April 24, 2019 Hi. Is this possible? qo.close; qo.sql.clear; qo.sql.add('select formname from options_t where idop = 255'); qo.open; qo.first; xf := TUniForm(f.qo.fieldbyname('formulario').asstring); xf.parent := UniPanel1; xf.align := alclient; xf.borderstyle := bsnone; xf.layout := 'fit'; xf.Show(); xf is defined as: xf: TUniForm; application raises an error in line: xf.parent := UniPanel1; The error is access violation. Any idea? Thanks. Link to comment Share on other sites More sharing options...
wprins Posted April 24, 2019 Share Posted April 24, 2019 Explain to me, what does the following line do, exactly? xf := TUniForm(f.qo.fieldbyname('formulario').asstring); I think that if you think about that line you'll sooner or later realise what you're doing wrong. If you still come up blank after pondering what you're doing there then post back... Link to comment Share on other sites More sharing options...
jahlxx Posted April 25, 2019 Author Share Posted April 25, 2019 I am trying to create a form with the name stored in a table. Perhaps the sintax in wrong, that's my question. Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted April 25, 2019 Share Posted April 25, 2019 Let's say you have TUniForm1 and Main. Add this to TUniForm1 initialization RegisterClass(TUniForm1); Then you can create a form with this code procedure TMainForm.UniButton1Click(Sender: TObject); var FrC : TUniFormClass; Fr : TUniForm; FClassName : string; begin FClassName := 'TUniForm1'; FrC := TUniFormClass(FindClass(FClassName)); Fr:=FrC.Create(UniApplication); Fr.ShowModal; end; Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now