Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement