Re: Update data from DBGrid

From: Sander Martens (koningsander_at_tvvbf.nl)
Date: 05/20/04

  • Next message: Bruce Roberts: "Re: stupidly desperate..halfword????"
    Date: Thu, 20 May 2004 23:03:26 +0200
    
    

    Hi,

    try running a query over the database.

    "Ken" <sross3@bigpond.net.au> schreef in bericht
    news:ajXqc.49147$TT.34119@news-server.bigpond.net.au...
    > Hi, I have run into a problem with the Delphi 7 app I am writing. I have
    an
    > MS-Access database with a few tables in it and using ADO connection. There
    > is a master/detail relationship between the batch and transactions tables.
    > I have an entry screen where the user selects the batch they want to work
    > on, and a DBGrid which displays the transactions for that batch. I want to
    > update (recalculate) the totals of the transactions credits and debits
    each
    > time the user adds a new transaction.
    > I tried using a query that sums the figures and open it each time a row is
    > changed, but this causes problems by moving the data cursor. I tried
    getting
    > the number of rows in the grid and summing the grid values, which looked
    > like it was going to work until the number of rows was greater than the
    grid
    > displays and it would only total the visible rows.
    > So. What is the best way to keep a running total of the data entered into
    a
    > DBGrid.
    >
    > Help is always appreciated.
    >
    > Cheers
    > Ken
    >
    >


  • Next message: Bruce Roberts: "Re: stupidly desperate..halfword????"

    Relevant Pages

    • Re: This one is a tough one...
      ... Forgive me if I misinterpret the query you suggested (probably I've ... > toolbar, to get a new line, total, in the grid. ... add 1 in the criteria line. ... >> In my database I have a list of errors occurring since inception. ...
      (microsoft.public.access.queries)
    • Re: Formulas
      ... I'm not sure what expressions you are talking about. ... click into the Queries tab on the database window ... In and empty column in the grid, type the formula Michel provided into ... Run the query and verify it does what you intend. ...
      (microsoft.public.access.queries)
    • Re: Formulas
      ... I'm not sure what expressions you are talking about. ... click into the Queries tab on the database window ... In and empty column in the grid, type the formula Michel provided into ... Run the query and verify it does what you intend. ...
      (microsoft.public.access.queries)
    • Re: Speed up ado updates
      ... On the select query end of things, you might want to try using the ... Recordset object's GetRows method, which returns all records as an array ... transactions might save significant time. ... smaller database tables. ...
      (comp.lang.ruby)
    • Re: Need To Create A Master Record
      ... in the database to see if the person is there and if so clicks n the name in the ... lookup list and autoenters the majority of the registration information. ... > You would then create a Query by adding these two tables to the query ... > on the transactions, ...
      (microsoft.public.access.gettingstarted)