Hello,
I tried sending this earlier but it hasn't appeared, so here goes again.
I'd like to update textboxes from values in a grid. I have a form method in the stgrid1.column1.text1 click event, which has this code.
***click event
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
store mbilldate to ThisForm.Sttxtdatebill.value
select stnbuyer
seek trim(thisForm.Stgrid1.Column3.Text1.value)
if fname <> " "
mlname = trim(fname) + " " + trim(lname)
else
mlname = trim(lname)
endif
maddress = trim(city) + ', ' + trim(state) + ' ' + country
store mlname to ThisForm.Sttxtlname.value
store maddress to ThisForm.Sttxtaddress.value
mldate = ThisForm.Sttxtmldate.value
mlastbilldate = ThisForm.Sttxtmlastbilldate.value
store ThisForm.Sttxtmlastbilldate.value to ThisForm.Sttxtlstbilldte.value
store ThisForm.Sttxtmldate.value to ThisForm.Sttxtservicedate.value
mcnt = mldate - mlastbilldate
mtot = (mamtdue * .0005) * mcnt
store mcnt to ThisForm.Sttxtlatecharge.value
thisform.refresh
***end of method
When the form refreshes, the only textbox with the new values is the one which relates to the grid1.column1.text1.
If I move the method to another grid textbox and click there it will update the textbox it relates to but not the others.
Any ideas would be appreciated.
Thanks,
Jim Harvey
jharvey@netrax.net