Code for each grid line

sonal_m

Active Member
I have to write a code for healderless detail form where for change in every ;ease number, an invoice number should be fetched ( grid level). If the lease number fro a grid row is same as previous row then same invoice number should be taken.

I wrote this code on grid row exit but it is taking too long and hence i cant do that.

Can anyone suggest a better way of doing this please.
 
Try a different event. Right-Click on the column "Lease number" in your FDA to find the column-event "Col Exited & changed ....".
 
Perhaps I am oversimplifying your issue but I believe you would want the logic on the Grid Record is fetched event. This way the logic will be performed as the grid records are retrieved from the database. Hope this helps.
 
This is while I add the records so I cant use the grid record is fetched.

I am now using a while loop running for all rows but I wanted to know any simpler way to do this.
 
Ho Sonal,

Take a workfile and insert all the records before and while entering(Ease # & Invoice #), Whenever they enter ease # it checks in workfile and fetches corresponding invoice # if exists.

Thanks,
Reddy
 
If you are entering the data into the line and you want the logic to execute after the line is entered row exited and changed is where you want to do it. Otherwise as WonderWhy said use column is exited and changed if you want the logic after a certain column is entered.

Perhaps if we had more information we might be of more help. I am not sure how a while loop would have better performance than what we indicated.

Good Luck!
 
Sonal

I suggest to use OK button clicked event to read through all your grid rows

1) read all your grid rows using system function
2) Fetch invoice# when ever there is a change in Lease#
3) Assign Invoice# of previous row if Lease# is as before.

Hope this helps!

BTW... The performance issue you observe might not be result of above assignment i guess.
 
Thanks all for your help.

I have now written the code on add grid rec to db before, so that after a line is entered. it takes place.
 
Back
Top