fanlinux90
Programmer
In the form I first click on the approve button and then on the pending button. in a form add a button to show the records with state 0. I use version 6 of visual fox pro.
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 f_temp
go top
Thisform.pr.RecordSource = ""
Thisform.pr.RecordSource = "f_temp"
with thisform.pr
.recordsource = .recordsource
endwith
Thisform.pr.column1.ControlSource = "f_temp.lastn"
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 pending procedure click
select doc, lastn, mname, name, phone, state,obs, apprvd;
from f_temp ;
where f_temp.state = 0 into cursor f_temp2
select f_temp2
go top
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
Only show the last record selected from the grid, how do I make it show all the records with state 0?
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 f_temp
go top
Thisform.pr.RecordSource = ""
Thisform.pr.RecordSource = "f_temp"
with thisform.pr
.recordsource = .recordsource
endwith
Thisform.pr.column1.ControlSource = "f_temp.lastn"
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 pending procedure click
select doc, lastn, mname, name, phone, state,obs, apprvd;
from f_temp ;
where f_temp.state = 0 into cursor f_temp2
select f_temp2
go top
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
Only show the last record selected from the grid, how do I make it show all the records with state 0?