Recent

Author Topic: datamodule  (Read 468 times)

Medhome

  • New Member
  • *
  • Posts: 17
datamodule
« on: August 07, 2022, 04:23:32 pm »
Hi all,

     I wrote a procedure  sumField in form1 and I want to replace the last procedure corresponding to afterOpen event in datamodule of my application.

Can I connect the AfterOpen event on the DataModule from Form1? .

Regards
Med

Nb:
I did datamod.dataset.afteropen := sumfield  in form1   No success.

 

jamie

  • Hero Member
  • *****
  • Posts: 4746
Re: datamodule
« Reply #1 on: August 07, 2022, 04:31:51 pm »
Data module is just another UNIT, include the unit name in the list of units in your USES list of where you need to access it from.
The only true wisdom is knowing you know nothing

Medhome

  • New Member
  • *
  • Posts: 17
Re: datamodule
« Reply #2 on: August 07, 2022, 04:37:12 pm »
The AfterOpen event  is fired in the datamodule not in form1! 

bpranoto

  • Full Member
  • ***
  • Posts: 109
Re: datamodule
« Reply #3 on: August 07, 2022, 05:31:06 pm »
I did datamod.dataset.afteropen := sumfield  in form1   No success.

try: datamod.dataset.afteropen := @form1.sumfield

Medhome

  • New Member
  • *
  • Posts: 17
Re: datamodule
« Reply #4 on: August 08, 2022, 02:51:45 pm »
HI bpranoto,

   That works.

     @sumfield   works also cause we are in form1 .

Thank you.

Med

 

TinyPortal © 2005-2018