Solved

Help with detecting a move within a Table ?

Posted on 2002-05-30
6
145 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
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!

 

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 100 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

Industry Leaders: 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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

726 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