Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function argument,value,type,count is invalid and record duplicate in the grid.

Status
Not open for further replies.

ninjaman01

Programmer
Aug 11, 2021
14
PH
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
 
What is the data type of mxRlvl? If it is something other than character, that would explain the error.

If it is numeric, and if rollevel is also a numeric data type (including integer or currency), then you don't need to use VAL().

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Yep its a numeric value for both the mxrlvl and rollevel, im currently working on it i will update if this solves the problem or not... thank you
 
I already resolved the editing button function of my program however i encounter a problem regarding to my add button, the problem is whenever i add a new record it duplicates and overwrite the record in my grid however when i check my table the record that i added is already added without any concerns.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top