Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Vijayendran
  Where is Vijayendran?
 Chennai
 India
 Vijayendran
 Tags
Subject: RE: Can anybody help me solve the error!!!
Thread ID: 22786 Message ID: 22787 # Views: 39 # Ratings: 0
Version: Visual FoxPro 5 Category: General VFP Topics
Date: Friday, April 25, 2003 3:30:19 PM         
   


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


COMPLETE THREAD

Can anybody help me solve the error!!! Posted by Vijayendran @ 4/25/2003 2:54:43 PM
RE: Can anybody help me solve the error!!! Posted by Pete Sass @ 4/25/2003 3:30:19 PM
RE: Can anybody help me solve the error!!! Posted by Vijayendran @ 4/26/2003 5:20:27 AM
RE: Can anybody help me solve the error!!! Posted by Ronald de Jesus @ 4/27/2003 3:53:18 AM
RE: Can anybody help me solve the error!!! Posted by Vijayendran @ 4/29/2003 5:21:50 AM
RE: Can anybody help me solve the error!!! Posted by Ronald de Jesus @ 4/29/2003 6:42:43 AM
RE: Can anybody help me solve the error!!! Posted by Ronald de Jesus @ 4/29/2003 6:52:13 AM
RE: Can anybody help me solve the error!!! Posted by Vijayendran @ 4/29/2003 2:12:05 PM