Hi John.
>> What >I'd like it to do, is display the sum amount of a price
field into a textbox, and be able to refresh whenever
I change or update a record. <<
Off the top of my head (read that as UNTESTED < s > ):
Create a form property called nTotalPrice. Bind your textbox to that. Create a method called DisplayTotal. Call it from the Valid of the text box in the grid that contains the price. Code in DisplayTotal:
LOCAL lnRecNo
lnRecno = RECNO( '< grids's RecordSource >' )
SUM < the price field > TO Thisform.nTotalPrice
GO lnRecNo IN < the RecordSource >
Thisform.txtTotalPrice.Refresh()
You will also want to call DisplayTotal whenever you change customers. The scope clause of the SUM command depends on your grid's RecordSource. Hopefully you are using a parameterized view for that and not a filter.
You do not want to use a SQL SUM because SQL operates in the contents of the table on the disk and does not see the changes in the buffer.
Marcia