Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Help with detecting a move within a Table ?

Posted on 2002-05-30
6
Medium Priority
?
149 Views
Last Modified: 2010-04-04
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
Comment
Question by:pjelias
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:pjelias
ID: 7043972
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
 
LVL 9

Expert Comment

by:ITugay
ID: 7044027
hi,

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

-------
Igor.
0
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 7044107
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:pjelias
ID: 7045766
Robert,

I have never done this, can you explain further ?

0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 300 total points
ID: 7046158
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
 

Author Comment

by:pjelias
ID: 7245893
Question open for a while.

Thanks for help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question