Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SET DELETED not working ...Part II
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00115534
Message ID:
00116873
Vues:
15
>>Main problem: >>I have the strangest thing happening (again). I have set deleted ON in my form, and a grid which its data source is a view. On the lostfocus method I have code that deletes the current field if empty, so, when I press ENTER, it fires the code, deletes the record and takes it out of sight(set deleted working), but, when I use the arrow UP key, it fires the code, deletes the record but STILL I can see it on the grid (set deleted not working), inclusive, the delete mark shows to the left of the grid. What's going on? Why this type of behaviour on something so basic? I've used REFRESH and everything you can think of, but nada.

>
>--snip--
>
>Gil, sorry for taking so long,
>
>First, have you followed the code through with the debugger to see if there are any differences between the code fired with enter and with the up/down arrows? There must be some code here, because normally you can't leave a grid with these keys.
>
>Second, I'd like to hear your answers to Larry's 3 questions. That may give us a clue.
>
>Barbara

Barbara & Larry:

Hi guys,

Barbara,

All keys that abandone the grid/column/textbox trigger the lost focus event. I've traced every single line of code and when using the enter key it does what is supposed to, but if use down arrow key it won't.

Larry,

1)Is the DELETED record there when you first open the form? Or are you deleting the record and it does not go away?

- No, what I'm doing is bringing a parameterized view of the line item table, being the initial value an empty one. Then, as the user selects products the view gets filled with these until the user finishes the order and changes are saved. The record that I'm deleting (code in the lost focus event of the grid/column/text box)is the empty record that the user is currently on and leaving to go to a previous or next object (text boxes). The record gets deleted, but when using the arrow keys (up or down), triggering the lost focus event of the field, the record remains visible on the grid, something that doesn't happen when pressing enter (the deleted record is not visible). This is the area with the confusion.

2)How is the data in the grid being generated? Is it a view or is it reading from a table directly?

- The data in the grid is from a parameterized view, which does not update its source table directly; I use it mainly as a container for the transaction. As the order is being taken, all the checks are performed in it and when it comes time to save, then this information is read an written in the tables they have to update. I guess it is like having a cursor.

3)If you are reading it from a view are you issuing a REQUERY() after the delete?

No, I tried that after you asked, and in the case of a new order, requerying deletes the content of the whole view since changes haven't been committed and there's not an order number generated yet, which happens when the user confirms saving.

Thanks a lot guys for helping out and have a good day,

Gil
For every bug fixed, there is a bigger bug not yet discovered.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform