MillBear


Hi all

I have a textbox, namely p2_labhr and a grid, namely dqqrid that contains 3 columns (Product Code, No. of Hours, Amount).

There is details displayed on the grid. Im citing an example as below.

Labour Hour : {textbox - p2_labhr ~~ *input: 100*}

Product Code

No. of Hours

Amount

AA1

3

300

BB2

4

400

CC3

2

200

DD4

1

100

The user wants to amend from 100 to 300 in the textbox. I like to see the whole column of Amount on the grid after the user changes the value in the textbox.

I tried this coding as below. It refreshes only one row instead of the whole column of Amount on the grid.

LostFocus procedure of p2_labhr object

select tdepotq *RecordSource of grid

goto top

do while .not. eof()

if not empty(p2code)

p2amount = (this.value*p2hours)

endif

skip

enddo

goto top

So, I need your help to correct my coding to achieve to refresh on the whole column of Amount on the grid.

Thank you.





Re: Refresh the whole column of 'Amount' on the grid

Dan Freeman


If you want to update your grid, you need to write new values to the data source. Your code does not do that.

Look up REPLACE or UPDATE in the help file.





Re: Refresh the whole column of 'Amount' on the grid

CetinBasoz

update tdepotq set p2amount = (this.Value * p2Hours)






Re: Refresh the whole column of 'Amount' on the grid

MillBear

Dan Freeman & CetinBasoz, thank you.




Re: Refresh the whole column of 'Amount' on the grid

nayef deeb

try refresh grid (thisform.gridname.refresh) or update your sourcedata for grid