Board index » delphi » Data aware controls and TQuery cachedUpdate

Data aware controls and TQuery cachedUpdate

I have a TQuery component that is a SQL join on two tables. The TQuery is
using cached updates and a TUpdateSQL component to handle inserts, updates
etc.

One of my forms has a set of data aware edit controls that reference fields
from the TQuery. What I'm looking to do is set a default value into one data
aware edit control based upon a value entered in another data aware edit
control.

Unfortunately I can't seem to find a TQuery event that I can use that will
handle this. The use of cached updates seems to bypass most of the obvious
events.

Any ideas?

 

Re:Data aware controls and TQuery cachedUpdate


Quote
On Tue, 9 Nov 1999 22:34:10 -0000, "davout" <dav...@dial.pipex.com> wrote:
>I have a TQuery component that is a SQL join on two tables. The TQuery is
>using cached updates and a TUpdateSQL component to handle inserts, updates
>etc.

>One of my forms has a set of data aware edit controls that reference fields
>from the TQuery. What I'm looking to do is set a default value into one data
>aware edit control based upon a value entered in another data aware edit
>control.

>Unfortunately I can't seem to find a TQuery event that I can use that will
>handle this. The use of cached updates seems to bypass most of the obvious
>events.

Cached updates has nothing to do with this. Take the same sort of approach
you would if cached updates were not even used.

One approach would be to create a handler for the OnChange event of the
triggering field. In the event handler, assign the appropriate value to the
receiving field. All of that assigning would be done with the usual dataset
methods, like Edit, FieldByName, and Post. The changes (to both fields)
would occur normally. It is just that because cached updates are enabled,
the changes go into the local cache rather than directly into the base
table.

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Steve Koterski              "Health nuts are going to feel stupid someday,
Felton, CA                  lying in hospitals dying of nothing."
                                                              -- Redd Foxx

Other Threads