[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Help with detecting a move within a Table ?

Hi,

I am using an ADOTable which is located in a DataModule (as other Forms etc may access this Table), and have a Form which accesses this DataModule and ADOTable.

The Form is used for DataEntry, and can be scrolled back and forth etc.

What I need to do, is on arrival of each record, certain fields may be enabled or disabled based on the value of certain fields.

I thought great, I can use the AFTERSCROLL EVENT attached to the ADOTable, BUT, I cannot see my form and the procedure I use to enable/disable the fields from the datamodule (possibly due to the fact that the form is not created until it is needed).

Could anyone advise on the easiest way around this, is there another way to do what I am after ??????


Thanks
pje
0
pjelias
Asked:
pjelias
  • 3
  • 2
1 Solution
 
pjeliasAuthor Commented:
I may have fixed the problem (moved the Table to the Form, although did not really want to do it).

Would still like to hear from people with any suggestions, will give the points to someone if I use the suggestion.


Thanks
pje
0
 
ITugayCommented:
hi,

if you use TDataSource then take a look at OnDataChange event. May be it something you looking for?

-------
Igor.
0
 
robert_marquardtCommented:
You have a simple component problem. You want to assign an Event at designtime to a Form which only exists at runtime.
The solution is so simple. Assign the event at runtime after you created the Form.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pjeliasAuthor Commented:
Robert,

I have never done this, can you explain further ?

0
 
robert_marquardtCommented:
An event is a normal property.

something like this:

TForm1 = class(TForm)
...
public
  procedure MyEventHandler(Sender: TObject);
end;

The above method is suitable for TNotifyEvents.

Somewhere in your code:

  Form1 := TForm1.Create(Self);
  // now you can assign the event handler
  SomeOtherObject.OnANotifyEventProperty := MyEventHandler;
  Form1.ShowModal;
  Form1.Release;

The main thing is that an event property is nothing else than a normal variable of method type.
0
 
pjeliasAuthor Commented:
Question open for a while.

Thanks for help.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now