Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete record
Message
From
08/06/2008 20:31:20
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
08/06/2008 14:53:56
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01322406
Message ID:
01322449
Views:
11
>Dear all,
>
>How to delete a record from a table, I find that I can't delete a record sucessfully.
>
>Am I?
>Select Myfile
>Delete Myfield="ValueIWantToDelete"
>tableupdate(.t.)
>
>where
>Cursor.BufferModeOverride=3 (or 5)
>
>However, I still see the deleted record in my reocrd page.
>
>I have SET DELETED ON
>
>What I have overlooked ??
>
>It should be unfortunate to 'PACK' everytime I delete a record !
>
>
>Regards,
>
>Ransome

Each table has a record pointer; once you are on the correct record, just give the command DELETE.

If you want to go to the correct record first, you can do something like locate for MyField = ..., before deleting.

If you are on a form, you have to go to another record after deleting - this is not automatic. For example:
* User has already selected the correct record, in the grid for example
delete
skip
if eof()
  go bottom
endif
ThisForm.Refresh()
HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform