Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Edit and Add on same Form
Message
 
 
To
31/12/2000 08:49:14
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00457515
Message ID:
00458202
Views:
23
Why are you doing a DELETE FOR? This scans the entire view and places the record pointer at EOF when finished. Since you are only updating the current record [your first parameter is ZERO], the update will fail. If you are just deleting the current record, just issue a DELETE [or DELETE NEXT 1] followed by the rest of your code.

>Hi Mark,
>
>I am trying out your method and like it very much. I am having a problem when I delete a record. On the page is two drop down list boxes where I show the company and the contact for that record. When I delete a record the contact list box becomes empty when it should contain a name. If I tab around the screen two times it shows up. All other times this works as expected. The list boxes are both bound to the view.
>
>I am using the following code to delete a record. iKey is the PK for that record.
>
>
>* Delete this Record
>DELETE FOR JobData.Jobid = ThisForm.iKey IN "JobData"
>* Send the update
>IF NOT TableUpdate( 0, .F., "JobData" )
>  * The update failed
>  TableRevert(.F., "JobData")
>ENDIF
>* Blank the view
>ThisForm.iKey = -1
>REQUERY("JobView")
>ThisForm.Refresh()
>
>
>Should I delete the record in another way?
>
>Thanks so much for your help.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform