Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary index key
Message
From
03/04/1997 01:52:13
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00026712
Message ID:
00026722
Views:
27
>>I have a very general form for entering Instructor information. The table fields are Lastname, Firstname and Company. The index is Lastname+Firstname+Company and is set to primary. This is very handy because FoxPro detects if a duplicate already exists when adding a record which I trap in a Valid method.
>>
>>My problem though is like this.....I delete a record...oops wrong one...I try to add it back in....the record already exists error is triggered. I have SET DELETED ON and I've confirmed this in the debugger. Am I missing something or do I have to code a work around for this type of case. If the latter some examples would be greatly appreciated.
>>
>>Thanx
>>
>>Colin Magee
>
>
>What you can DELETE, can be RECALLed...
>
>RECALL (scope) FROM (alias) ect.
The primary key does not care if a record is deleted or not, it still is in the dbf.
In your valid routine I would add something like


SET DELE OFF
IF SEEK(namestring)
if deleted()
recall
else
*your duplicate found message
SET DELE ON
RETURN(0)
endif
ENDIF
SET DELE ON
RETURN
L.A.Long
ProgRes
lalong1@charter.net
Previous
Reply
Map
View

Click here to load this message in the networking platform