Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid updates erroneous information vfp6

Status
Not open for further replies.

fanlinux90

Programmer
Oct 31, 2022
22
CO
form1 init procedure
use C:\dbfs\pr in 0 shared

select doc, lastn, mname, name, phone, state,obs, apprvd;
from pr ;
where pr.state = 0 or pr.state = 5 into cursor f_temp1

select f_temp1
afields (f_temp_f)
create cursor f_temp from array f_temp_f
append from dbf('f_temp1')

Thisform.pr.RecordSource = "f_temp"

with thisform.pr
.recordsource = .recordsource
endwith

Thisform.pr.column1.ControlSource = "f_temp.doc"
Thisform.pr.column2.ControlSource = "f_temp.lastn"
Thisform.pr.column3.ControlSource = "f_temp.mname"
Thisform.pr.column4.ControlSource = "f_temp.name"
Thisform.pr.column5.ControlSource = "f_temp.phone"
Thisform.pr.column6.ControlSource = "f_temp.state"
Thisform.pr.column7.ControlSource = "f_temp.obs"
Thisform.pr.column8.ControlSource = "f_temp.apprvd"

thisform.pr.setfocus()
Thisform.pr.refresh
thisform.refresh

button approved procedure click

select f_temp
go top
scan
If f_temp.apprvd = .T.
select f_temp
replace f_temp.estado with 4 for empty(f_temp.desc_obj)

SELECT f_temp
for ve = 1 to reccount()
select f_temp
go ve
If f_temp.apprvd = .T.
update Pr set pr.estate = f_temp.state where pr.doc = f_temp.doc
endif
endfor

endif
endscan

select f_temp
go top
scan
If f_temp.aprobado = .T.
select f_temp
replace f_temp.estado with 5 for !empty(f_temp.desc_obj)

SELECT f_temp
for ve = 1 to reccount()
select f_temp
go ve
If f_temp.apprvd = .T.
update Pr set pr.estate = f_temp.state where pr.doc = f_temp.doc
endif
endfor

endif
endscan


select doc, lastn, mname, name, phone, state,obs, apprvd;
from f_temp ;
where f_temp.state = 0 or f_temp.state = 5 into cursor f_temp2

Thisform.pr.RecordSource = "f_temp2"

with thisform.pr
.recordsource = .recordsource
endwith

Thisform.pr.column1.ControlSource = "f_temp2.lastn"
Thisform.pr.column2.ControlSource = "f_temp2.lastn"
Thisform.pr.column3.ControlSource = "f_temp2.mname"
Thisform.pr.column4.ControlSource = "f_temp2.name"
Thisform.pr.column5.ControlSource = "f_temp2.phone"
Thisform.pr.column6.ControlSource = "f_temp2.state"
Thisform.pr.column7.ControlSource = "f_temp2.obs"
Thisform.pr.column8.ControlSource = "f_temp2.apprvd"

thisform.pr.setfocus()
Thisform.pr.refresh
thisform.refresh

When I click on the approved button in the grid, it only shows the records that have state 0 and obs full, it does not show the fields that have state 0, obs empty and that were not selected by the check.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top