> In my form, when i click edit cmdButton, always only the first record gets updated & not the selected one. The code i write for my edit cmd Button is:
> This is the code i write in my Edit cmd button:
>
> Recstatus = 'E'
>
> With thisform
> .grid1.enabled=.f.
> .grid2.enabled=.t.
> .combo1.enabled=.t.
> .combo2.enabled=.t.
> .ovcode.enabled = .f.
> .command1.enabled = .f.
> .command2.enabled = .f.
> .command3.enabled = .f.
> .command4.enabled = .f.
> .command5.enabled = .t.
> .command6.enabled = .t.
> .command7.enabled = .f.
> .command8.enabled = .f.
> .oinput.enabled = .f.
> .oinstage.enabled = .f.
> .ooutput.enabled =.f.
> .ooutstage.enabled = .f.
>
> Endwith
>
> With thisform
> .ovcode.value = mos_in_output.vcode
> .oinput.value = mos_in_output.input
> .oinstage.value=mos_in_output.instage
> .ooutput.value=mos_in_output.output
> .ooutstage.value=mos_in_output.outstage
> Endwith
>
> Sele gstockmast
> seek minput+minstage
> If found()
> Thisform.combo1.value = gstockmast.partno
> Endif
>
> Sele gstockmast
> seek moutput+moutstage
> If found()
> Thisform.combo1.value = gstockmast.partNo
> Endif
>
> This is the code i write in save cmd button:
>
> LOCAL Inselect, x
> x = 0
> Inselect = select()
>
> Sele mos_in_output
> Do case
> case Recstatus='A'
> Append Blank
> Repl vcode with mvcode
> Repl input with minput, instage with minstage,output with moutput, outstage with moutstage
>
> case Recstatus = 'E'
> Sele mos_in_output
> seek minput+minstage+moutput+moutstage
> Repl vcode with mvcode
> Repl input with minput, instage with minstage,output with moutput, outstage with moutstage
> endcase
>
> *TABLEUPDATE(.T.)
> select(inselect)
> With thisform
> .grid1.enabled=.f.
> .grid2.enabled=.t.
> .combo1.enabled=.f.
> .combo2.enabled=.f.
> .ovcode.enabled = .f.
> .command1.enabled = .t.
> .command2.enabled = .t.
> .command3.enabled = .t.
> .command4.enabled = .f.
> .command5.enabled = .f.
> .command6.enabled = .f.
> .command7.enabled = .t.
> .command8.enabled = .f.
> .oinput.enabled = .f.
> .oinstage.enabled = .f.
> .ooutput.enabled =.f.
> .ooutstage.enabled = .f.
>
> Endwith
>
> *!* With thisform
> *!* .oinput.value =''
> *!* .oinstage.value=''
> *!* .ooutput.value=''
> *!* .ooutstage.value=''
> *!* Endwith
>
> Thisform.refresh()
>
> Can anybody tell me as to where do i go wrong.
>
> Regards
> Vijayendran S
Hi,
I am having a hard time following exactly what your logic is within the command buttons.
I suggest you hard code in a browse command in the save logic to verify where your
record pointer is just prior to issuing the =tableupdate(.t.) command.
I take it recstatus='E' is the editing of the current record. If you are editing the current
record and your pointer is on it, why are you issueing a seek prior to the =tableupdate(.t.)
command. Again, I do not fully understand your logic here.
Pete from the Great White North. (Only in Canada, ay.) Over and Out ...