General information
Category:
Coding, syntax & commands
Title:
Repalce and Delete Commands Not Working - help needed
Dear Everyone,
I have a code which doing a delete function, before delete, i want to change the primary key to 1 of the unique string by calling SYS(2015).
Below is my code :-
lnRecNo = RECNO()
Replace usercode with SYS(2015) Record lnRecNo
DELETE FROM tsmtranh WHERE usercode=thisform.txtUserCode.Value
After running the program, the usercode has been updated but the record is not deleted. If I comment the Replace command, the delete command just works fine. Why???
I suspect that the value of usercode has been change but thisform.txtUserCode.Value still keeps the old value. So I change my code to below:-
lnRecNo = RECNO()
lstrVal = SYS(2015)
Replace usercode=lstrVal Record lnRecNo
DELETE FROM tsmtranh WHERE usercode=lstrVal
But it still doesn't work.
Anyone out there knows why?
TQ.
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