ninjaman01
Programmer
Hi Guys, anyone can help me on my problem. I'm currently working on a employee role data entry form. My problem is when i tried to save the added record. the save button duplicates and overwrite the record in the grid even thought if i check the table it is completely fine and when i try to edit a record from the grid when i save it a function argument error occurs. this is my code for reference.
if mproceed
thisform.txtRoles.value = mxRoles
thisform.Rlvl.value = mxRlvl
if thisform.daction = 1 <------------ adding record condition.
append blank
endif
replace emprole with mxRoles
replace rollevel with val(mxRlvl)<--------- this line is the error when saving the edited record from the table.
thisform.dbutton(.t.,.f.,.f.,.t.,.t.)
thisform.dencode(.f.,.f.)
endif
else
sele emprole<-------- edit button condition
goto top
thisform.dencode(.t.,.t.)
replace rollevel with mxRlvl
endif
if mproceed
thisform.txtRoles.value = mxRoles
thisform.Rlvl.value = mxRlvl
if thisform.daction = 1 <------------ adding record condition.
append blank
endif
replace emprole with mxRoles
replace rollevel with val(mxRlvl)<--------- this line is the error when saving the edited record from the table.
thisform.dbutton(.t.,.f.,.f.,.t.,.t.)
thisform.dencode(.f.,.f.)
endif
else
sele emprole<-------- edit button condition
goto top
thisform.dencode(.t.,.t.)
replace rollevel with mxRlvl
endif