fanlinux90
Programmer
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.
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.