Source language: Translate to:

Calculated field in Grid View

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Calculated field in Grid View

Postby donmichel » Fri Jul 01, 2011 9:34 am

In the grid view is there a way to make the calculated value appear in the total or sum field when I enter the values in the other fields? I have Field1, Field2 and Field3 where I enter the values in the grid view. As soon as I enter the values the total, sum or calculated value should appear in Field4. Is it possible?
Posts: 38
Joined: Sun Sep 14, 2008 1:25 am

Postby Neosoft Support » Fri Jul 01, 2011 11:53 am

There's no way to have DBPro do the calculation automatically in a table. You could try performing the calculation in the table's OnChange subroutine. Another possible option is to create your table with MS Access with a calculated field, then open it with DBPro and see if the calculated field works there.
NeoSoft Support
Neosoft Support
NeoSoft Team
Posts: 5620
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby donmichel » Sat Jul 02, 2011 7:40 am

The onchange subroutine works, but it does not get the calculated value displayed immediately. I have to navigate the records forward and backward and again forward when the calculated value is displayed correctly. Not useful for the purpose. I hope some tweaks might help.
Posts: 38
Joined: Sun Sep 14, 2008 1:25 am

Postby Wrangler » Sat Jul 02, 2011 8:17 am

Try dbpsaveedits after the calculation.
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
User avatar
Posts: 1513
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: Calculated field in Grid View

Postby David de Argentina » Sat Dec 22, 2012 12:28 am

dbpExecSQL "dbID" "SELECT table1.Name AS Name, table2.Last_Operation AS Last_Operation, table1.amount + table2.interest AS Calculated_Field FROM table1 LEFT JOIN table2 on table1.ID = table2.ID WHERE table1.Code = 123;" "NewTable"

dbpOpenTable "dbID" "NewTable" ""
dbpShowGrid "dbGrid" "Rectangle" "NewTable"


My devaluated cent,
David de Argentina
User avatar
David de Argentina
Posts: 1590
Joined: Mon Apr 04, 2005 4:13 pm
Location: Buenos Aires, Argentina

Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 2 guests