DBgrid update

heinven
heinven used Ask the Experts™
on
How can I update my  summary dbgrid automatically when I assign a new record to my descritive dbgrid for exp. when I put new expenses in the one table and have the sum of all the expenses in a different table ( my dbgrids are connected with ms access)
14443795638621528496386.jpg
1444379706061-1790036887.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software architect
Top Expert 2012
Commented:
If your dataset is connected to real (access) database - new record will be stored in db, so you need to re-query your second query (sum) - after posting - if both forms are active.
qry.Close;
qry.SQL.Text := 'select Period, sum(Value) as Total, ... from tabel2 order by ...'

Open in new window

... if second form is  not active, just re-open query on each OnShow event.
Geert GOracle dba
Top Expert 2009
Commented:
you can't automatically
an event must be fired and reacted upon

for example  update fires afterupdate and in this you refresh the summary

some grids like devexpress quantumgrid allow summarized fields which are automatically updated
those values are not stored in the database, but in the app grid memory
Geert GOracle dba
Top Expert 2009

Commented:
fwiw ...
you can take a screenshot with printscreen ...
open paint and paste the image
and then cut out the area you want with crop

did you really use your smartphone for that screenshot ?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial