if varmodi <> "m"Ese sería el código del boton "grabar". El problema ocurre cuando, por mediante del formulario, intento modificar los datos de lo que sería una persona que ya está en la tabla.
append blank
endif
thisform.List1.enabled=.t.
thisform.ALTA.enabled=.t.
thisform.BAJA.enabled=.t.
thisform.MODIFICAR.enabled=.t.
thisform.CANCELAR.enabled=.f.
thisform.GRABAR.enabled=.f.
thisform.SALIDA.enabled=.t.
replace ficha.ficcod with thisform.text1.value
replace ficha.ficape with thisform.text2.value
replace ficha.ficnom with thisform.text3.value
replace ficha.ficdni with thisform.text4.value
replace ficha.ficsue with thisform.text5.value
replace ficha.ficfdn with thisform.text6.value
replace ficha.ficobs with thisform.text7.value
If thisform.check2.value=1
replace ficha.ficmed with .T.
else
replace ficha.ficmed with .F.
endif
If thisform.check1.value=1
replace ficha.ficani with .T.
else
replace ficha.ficani with .F.
endif
If thisform.check3.value=1
replace ficha.ficaca with .T.
else
replace ficha.ficaca with .F.
endif
If thisform.check4.value=1
replace ficha.ficpic with .T.
else
replace ficha.ficpic with .F.
endif
If thisform.check5.value=1
replace ficha.ficali with .T.
else
replace ficha.ficali with .F.
endif
If thisform.check6.value=1
replace ficha.ficpol with .T.
else
replace ficha.ficpol with .F.
endif
If thisform.check7.value=1
replace ficha.ficotr with .T.
else
replace ficha.ficotr with .F.
endif
If thisform.check7.value=1
replace ficha.ficotr2 with thisform.text8.value
endif
replace ficha.ficmed2 with thisform.combo1.value
replace ficha.ficani2 with thisform.combo2.value
replace ficha.ficali2 with thisform.combo3.value
replace ficha.ficpic2 with thisform.text9.value
Do case
case thisform.optiongroup1.value=6
replace ficha.fichij with "No tiene"
case thisform.optiongroup1.value=1
replace ficha.fichij with "1"
case thisform.optiongroup1.value=2
replace ficha.fichij with "2"
case thisform.optiongroup1.value=3
replace ficha.fichij with "3"
case thisform.optiongroup1.value=4
replace ficha.fichij with "4"
case thisform.optiongroup1.value=5
replace ficha.fichij with "Más de 4"
Endcase
thisform.text1.enabled=.f.
thisform.text2.enabled=.f.
thisform.text3.enabled=.f.
thisform.text4.enabled=.f.
thisform.text5.enabled=.f.
thisform.text6.enabled=.f.
thisform.text7.enabled=.f.
thisform.text1.value=ficha.ficcod
thisform.text2.value=ficha.ficape
thisform.text3.value=ficha.ficnom
thisform.text4.value=ficha.ficdni
thisform.text5.value=ficha.ficsue
thisform.text6.value=ficha.ficfdn
thisform.text7.value=ficha.ficobs
thisform.list1.displayvalue=ficha.ficcod
thisform.list1.requery
thisform.list1.refresh
thisform.list1.setfocus
thisform.list1.click
thisform.list1.enabled=.t.