General information
Category:
Forms & Form designer
Hi Christof!
I'm using VFP 3. The setfocus is in a user defined method in the main form. Although I have tried putting in other places. I can actually see the editbox receive the focus when I run the modify option but it immediately jumps to the next enabled editbox. I'm sure it's something simple that I'm just overlooking. The code is listed below. It gets kinda lengthy because of the number of controls on the form.
*file_maintenance
*maintbtn.click
* menu add, modify, delete
set confirm on
set esca off
thisform.setall("enabled",.f.,"commandbutton")
thisform.cmgtsave71.savebtn.enabled=.t.
thisform.cmgtcancel72.cancelbtn.enabled=.t.
public cont2
store 0 to cont2
do form sam1a3.scx to cont2 &&add,mod,del buttons
if cont2 = 0
thisform.setall("enabled",.t.,"commandbutton")
thisform.cmgtsave71.savebtn.enabled=.f.
thisform.cmgtcancel72.cancelbtn.enabled=.f.
thisform.refresh
return
endif
do case
case cont2 = 1
thisform.caption="file maintenance - add new record"
thisform.add_rec
case cont2 = 2
thisform.caption="file maintenance - modify record"
thisform.mod_rec
case cont2 = 3
* code to delete record here
store .f. to continue
thisform.del_rec
otherwise
endcase
*sam1a3.scx
*modifybtn.click
cont2=2
thisform.release
*sam1a3.scx
*maint_menu.unload
return cont2
*file_maintenance.mod_rec
*modify a record
public currec
teditting=.t.
save to tempfile all like *
currec=recno()
thisform.enable_btns
thisform.txtdlp2.enabled=.f.
thisform.txtdueqty.enabled=.f.
thisform.txtddueqty.enabled=.f.
thisform.txtinvinproc.enabled=.f.
thisform.txtniin.enabled=.f.
thisform.txtniin.borderstyle=0
thisform.txtohqty.enabled=.f.
thisform.txtohqty.borderstyle=0
thisform.txtlstinv.enabled=.f.
thisform.txtlstinv.borderstyle=0
thisform.txtsetname.enabled=.f.
thisform.txtnrfi.enabled=.f.
thisform.txtfsc.enabled=.t.
thisform.txtfsc.visible=.t.
thisform.txtfsc.setfocus
*file_maintenance.enable_btns
*enables buttons
thisform.setall("enabled",.f.,"commandbutton")
thisform.cmgtsave71.savebtn.enabled=.t.
thisform.cmgtcancel72.cancelbtn.enabled=.t.
thisform.txtsmic.enabled=.t.
thisform.txtsmic.borderstyle=1
thisform.txtsmic.specialeffect=0
thisform.txtfsc.borderstyle=1
thisform.txtfsc.specialeffect=0
thisform.txtfsc.enabled=.t.
thisform.txtfsc.visible=.t.
thisform.txtniin.enabled=.t.
thisform.txtniin.borderstyle=1
thisform.txtniin.specialeffect=0
thisform.txtpartno.enabled=.t.
thisform.txtpartno.borderstyle=1
thisform.txtpartno.specialeffect=0
thisform.txtdlp2.enabled=.t.
thisform.txtui.enabled=.t.
thisform.txtui.borderstyle=1
thisform.txtui.specialeffect=0
thisform.txtcog.enabled=.t.
thisform.txtcog.borderstyle=1
thisform.txtcog.specialeffect=0
thisform.txtatc.enabled=.t.
thisform.txtatc.borderstyle=1
thisform.txtatc.specialeffect=0
thisform.txtmcc.enabled=.t.
thisform.txtmcc.borderstyle=1
thisform.txtmcc.specialeffect=0
thisform.txtlmc.enabled=.t.
thisform.txtlmc.borderstyle=1
thisform.txtlmc.specialeffect=0
thisform.txtrtc.enabled=.t.
thisform.txtrtc.borderstyle=1
thisform.txtrtc.specialeffect=0
thisform.txtohqty.enabled=.t.
thisform.txtohqty.borderstyle=1
thisform.txtohqty.specialeffect=0
thisform.txtdueqty.enabled=.t.
thisform.txtddueqty.enabled=.t.
thisform.txtro.enabled=.t.
thisform.txtro.borderstyle=1
thisform.txtro.specialeffect=0
thisform.txtrp.enabled=.t.
thisform.txtrp.borderstyle=1
thisform.txtrp.specialeffect=0
thisform.txtdemand.enabled=.t.
thisform.txtdemand.borderstyle=1
thisform.txtdemand.specialeffect=0
thisform.txtfreq.enabled=.t.
thisform.txtfreq.borderstyle=1
thisform.txtfreq.specialeffect=0
thisform.txtfgc.enabled=.t.
thisform.txtfgc.borderstyle=1
thisform.txtfgc.specialeffect=0
thisform.txtfrc.enabled=.t.
thisform.txtfrc.borderstyle=1
thisform.txtfrc.specialeffect=0
thisform.txtnrfi.enabled=.t.
thisform.txtitemno.enabled=.t.
thisform.txtitemno.borderstyle=1
thisform.txtitemno.specialeffect=0
thisform.txtop.enabled=.t.
thisform.txtop.borderstyle=1
thisform.txtop.specialeffect=0
thisform.txtslc.enabled=.t.
thisform.txtslc.borderstyle=1
thisform.txtslc.specialeffect=0
thisform.txtslac.enabled=.t.
thisform.txtslac.borderstyle=1
thisform.txtslac.specialeffect=0
thisform.txtup.enabled=.t.
thisform.txtup.borderstyle=1
thisform.txtup.specialeffect=0
thisform.txtnet_up.enabled=.t.
thisform.txtnet_up.borderstyle=1
thisform.txtnet_up.specialeffect=0
thisform.txtinvinproc.enabled=.t.
thisform.txtlstinv.enabled=.t.
thisform.txtlstinv.borderstyle=1
thisform.txtlstinv.specialeffect=0
thisform.txtnomen.enabled=.t.
thisform.txtnomen.borderstyle=1
thisform.txtnomen.specialeffect=0
thisform.txtshiprmrk.enabled=.t.
thisform.txtshiprmrk.borderstyle=1
thisform.txtshiprmrk.specialeffect=0
thisform.txtloc1.enabled=.t.
thisform.txtloc1.borderstyle=1
thisform.txtloc1.specialeffect=0
thisform.txtloc2.enabled=.t.
thisform.txtloc2.borderstyle=1
thisform.txtloc2.specialeffect=0
thisform.txtloc3.enabled=.t.
thisform.txtloc3.borderstyle=1
thisform.txtloc3.specialeffect=0
thisform.txtloc4.enabled=.t.
thisform.txtloc4.borderstyle=1
thisform.txtloc4.specialeffect=0
thisform.txtamd.enabled=.t.
thisform.txtamd.borderstyle=1
thisform.txtamd.specialeffect=0
thisform.txtfscm.enabled=.t.
thisform.txtfscm.borderstyle=1
thisform.txtfscm.specialeffect=0
thisform.txtpsin.enabled=.t.
thisform.txtpsin.borderstyle=1
thisform.txtpsin.specialeffect=0
thisform.txtsetname.enabled=.t.
Thanks for your time and help.
Felisa
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only