Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5 grid behavior
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00314057
Message ID:
00314253
Views:
21
>Hello All,
>
>I'm trying to use a grid to update the values of textboxes on a form.
>
>This code is in a form method which is in the click event of stgrid1.column1.text1;
>
>thisform.setall("visible", .t.,"sttextbox")
>thisform.setall("visible", .t.,"stlabel")
>store ThisForm.Stgrid1.Column1.Text1.value to ThisForm.Sttxthipno.value
>store ThisForm.Stgrid1.Column2.Text1.value to ThisForm.Sttxtname.value
>store thisForm.Stgrid1.Column3.Text1.value to ThisForm.Sttxtacct.value
>store ThisForm.Stgrid1.Column4.Text1.value to ThisForm.Sttxtamtbid.value
>store ThisForm.Stgrid1.Column5.Text1.value to ThisForm.Sttxtamtpaid.value
>store ThisForm.Stgrid1.Column7.Text1.value to ThisForm.Sttxttype.value
>mamtdue = stntrans.amount - stntrans.amtpaid
>mbilldate = stntrans.billdate
>select stnbuyer
>seek thisForm.Stgrid1.Column3.Text1.value
>if fname <> " "
>mlname = trim(fname) + " " + trim(lname)
>else
>mlname = trim(lname)
>endif
>maddress = trim(city) + ', ' + trim(state) + ' ' + country
>mldate = ThisForm.Sttxtmldate.value
>mlastbilldate = ThisForm.Sttxtmlastbilldate.value
>mcnt = mldate - mlastbilldate
>mtot = (mamtdue * .0005) * mcnt
>thisform.refresh
>
>When the user clicks the textbox in the grid, only the textbox on the form that corresponds with the grid has it's value updated. All the others remain stagnant.
>
>I've tried moving the method to the afterrowcolchange event to no avail.
>
>The grid's source if a free table, while the textboxes have no control source.
>
>Any ideas appreciated.
>
>Jim Harvey
>jharvey@netrax.net

Your code has some generic problems.
In regard to the specific question that you ask, you may get better results if you don't use Grid.Column.Text.Value, better use field values of the underlying table (recordsource), e.g.
Thisform.Mytext1.Value=mytable.field1
Thisform.Mytext2.Value=mytable.field2
etc.
You may safely do it from Grid.AfterRowColumnChange event
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform