troubleshooting Question

BeforePost Event

Avatar of mc94051
mc94051 asked on
5 Comments1 Solution463 ViewsLast Modified:
Hi everyone,

I have a problem with a custom component I 've made consisting of a TButton and a TDBEdit. I have some code which does some validation and I want it to apply to all instances of my control. I do this on the BeforePostEvent of the control's dataset with the following code in the constructor of my component:

constructor customcomponent.Create(AOwner: TComponent);
    Self.DataSource.DataSet.BeforePost := DBEditBeforePost;

procedure customcomponent.DBEditBeforePost(DataSet: TDataSet);
    Code X;

Then I go on a form with the customcomponent on it and a TTable with name "aTable":

procedure TfrmPurchaseOrder.aTableBeforePost(DataSet: TDataSet);
    Code Y;

My problem with this is that when I assign some code in the BeforePost event of the form containing my component although "inherited" is there the form's code is not executed (Code Y in the example) but only the component's (Code X in the example). Is there anything I can do to execute 'Code X' via the inherited and 'Code Y' next???

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros