Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Repalce and Delete Commands Not Working - help needed
Message
From
13/10/1998 04:44:22
Yin Min Chen
Nec Home Electronics(M) Sdn Bhd
Sungai Petani, Malaysia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Repalce and Delete Commands Not Working - help needed
Miscellaneous
Thread ID:
00146137
Message ID:
00146137
Views:
62
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
Map
View

Click here to load this message in the networking platform