Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is wrong with my code?
Message
From
04/02/2003 12:45:53
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00748355
Message ID:
00748945
Views:
17
SELECT table1
SEEK ALLTRIM(THISFORM.idcode.Value)+ALLTRIM(THISFORM.idcode2.Value)
IF FOUND()
SELECT table1
DELETE
WAIT WINDOW 'Record has been deleted.'

THISFORM.Refresh
ELSE
WAIT WINDOW Record does not exist'
ENDIF
SELECT table1

I am assuming you have the order selected for the seek in the properties, if not you will need a:
SET ORDER TO TAG
after the select

I find that IF FOUND() and IF (.not. EOF()) don't always work too smooth, so I would try checking to see if your find matched instead:
IF ALLTRIM(THISFORM.idcode.Value) = alltrim(table1.field1) .and. ALLTRIM(THISFORM.idcode2.Value) = alltrim(table1.field2)

If these do not work, put a SET STEP ON right before the seek and put the table values in your watch window to see where they are after the seek.
``` Appreciate a normal day, it is always better than a bad one ```

Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform