Board index » delphi » Auto update on DBGrid

Auto update on DBGrid

Hi

(Using Delphi 1, Dbase engine)

I have a data base that must the allow the user to update a table while
in grid format, but must also allow the user to up in a form format.
The grid shows on the screen, and next to the grid is a button labelled
"Update in Form View"  If the user clicks on that, they get the for
view, and add/edit records.  When they close, the form view, though, the
grid still reflects the old status - the user has to click the update
button in order to get it to re-read the table.  Is there any way to get
it to update automatically?
I've tried to use things like DBNavigator1.Update in the Form show (or
the form close on the form input), but nothing helps.

Any ideas apperciated.

Thanks
--
Ken Masters
University of Cape Town
Cape Town, South Africa
Computer-Based Education? See http://www.uct.ac.za/projects/cbe/
----------------------------------------------------------------

 

Re:Auto update on DBGrid


In article <3630412D.7...@its.uct.ac.za>, Ken Masters <k...@its.uct.ac.za>
writes:

Quote
>I have a data base that must the allow the user to update a table while
>in grid format, but must also allow the user to up in a form format.
>The grid shows on the screen, and next to the grid is a button labelled
>"Update in Form View"  If the user clicks on that, they get the for
>view, and add/edit records.  When they close, the form view, though, the
>grid still reflects the old status - the user has to click the update
>button in order to get it to re-read the table.  Is there any way to get
>it to update automatically?
>I've tried to use things like DBNavigator1.Update in the Form show (or
>the form close on the form input), but nothing helps.

Are you using the same TDataSource and TTable for the DBGrid update as for the
 form update ?

TTable.Postshould do it all, or TTable.UpdateRecord brings the current copy of
the record up to date with the controls without Post-ing it. Post calls
UpdateRecord before changing the table record.

Alan Lloyd
alangll...@oal.com

Alan Lloyd
alangll...@aol.com

Re:Auto update on DBGrid


Hi
[snip]
Quote

> Are you using the same TDataSource and TTable for the DBGrid update as for the
>  form update ?

[snip]

Thanks - From another user, I got "Table1.Refresh" and that did it.

--
Ken Masters
University of Cape Town
Cape Town, South Africa
Computer-Based Education? See http://www.uct.ac.za/projects/cbe/
----------------------------------------------------------------

Other Threads