Update a field in a Data Grid after edit

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
RobertNM
Posts: 1
Joined: Sat Oct 17, 2015 5:48 pm

Update a field in a Data Grid after edit

Post by RobertNM » Sat Oct 17, 2015 9:27 pm

I am using a Data Grid to display a list of Customers.

The database contains four fields.
Customer, Previous Reading, Current Reading, Used

When the user enters an amount into "Current Reading" I want the results of:
"Current Reading" - "Previous Reading" to be entered into the field "Used"
Field 3 minus Field 2 equals Field 4
How can I do this and where do I insert the code?

I believe that it goes somewhere in the Current Behavior of the Data Grid Template.

Thank you,
RobertNM

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Update a field in a Data Grid after edit

Post by MaxV » Tue Oct 20, 2015 10:36 pm

Just use:

Code: Select all

on CloseFieldEditor pFieldEditor
    #you code
end CloseFieldEditor 
Add this message in datagrip group script.
For more informationS see: http://livecode.wikia.com/wiki/Datagrid_API
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Databases”