Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Triggers in a form
Message
 
 
À
05/01/2001 00:51:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00459678
Message ID:
00459714
Vues:
34
Hi!

You tried to turn around all working with data. Trigger is database part, so it should never do something with the client part. As opposite, Client part only should show data from database part.

In your case, you should make a code in your form or edit box to update self. How you will know that some account is zero? Query to database. If you want to show this immediately to user, you can do this by timer each second. The scenario looks like following:

Other users work with database and update data. Your form contains timer. In the Timer event you query database and check if special account contains zero (or whatever). If yes - assign something to the editbox.value property. If no - clear editbox (if needed).

If query to database too complex or will last too long, you can eitehr adjust timer to fire using longer time frames (say, 5 seconds). Another solution - in the trigger switch on some special flag or add special record to ther system table (messaging table) and at the client application query only that flag or that special table.

HTH.

>Hi everybody!
>
>Is there a way to send information to a Editbox when a trigger fires up?
>I have a form with a editbox and I want know when an specific field (balance) is equal to 0. I tried with a trigger update and stored procedure but I can't figure out how to put this information into the editbox.
>
>Here's my code:
>
>Create trigger on inventory for Update as IsBalanceZero()
>
>Procedure IsBalanceZero
>
>if _triggerlevel = 1
> if inventory.balance = 0 then
> wait window "Equal to 0"
> * here I'd like to send this info to the editbox
> * thisform.Edit1.value = Inventory.Item_ID + "Re-order"
> endif
>return .t.
>endif
>EndProc
>
>thanks in advance
>Happy New Year!!!
>
>Martin Alcaraz
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform