Solved

Help with detecting a move within a Table ?

Posted on 2002-05-30
6
142 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
  • 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

829 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