Solved

Help with detecting a move within a Table ?

Posted on 2002-05-30
6
139 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:pjelias
Comment Utility
Robert,

I have never done this, can you explain further ?

0
 
LVL 11

Accepted Solution

by:
robert_marquardt earned 100 total points
Comment Utility
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
Comment Utility
Question open for a while.

Thanks for help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now