Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Verfield()
Message
De
15/11/2000 15:55:50
Jorge Haro
Independent Consultant
Juarez, Mexique
 
 
À
15/11/2000 15:47:38
Chuck Tripi
University of Wisconsin - Milwaukee
Milwaukee, Wisconsin, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00441618
Message ID:
00442316
Vues:
9
Oh I see, you need to return .F. (False) from your function, if you followed the instructions I gave you in the previous message it won't let you move from the record, and it will give you the option to revert, your function should return .T. when conditions are met of course, or else you'll never be able to add a record.

In short you have to put the function name as a record validation rule, and the function must return .T. or .F. accordingly. Feel free to ask if you need more clarification on this.

>FUNCTION verfield
> DO CASE
>
> CASE ALLTRIM(UPPER(authtype)) = "VISA"
> IF limit = 0 OR EMPTY(fund) OR EMPTY(account) OR ISNULL(fund) OR ISNULL(account)
> WAIT WINDOW "Can not allow that, fix it!"
> ENDIF
>
> CASE ALLTRIM(UPPER(authtype)) = "BUDGET TRANSFERS"
> IF limit = 0
> WAIT WINDOW "The amount can not be zero"
> ENDIF
>
> CASE ALLTRIM(UPPER(authtype)) = "HIRING"
> IF effective = {} OR ending = {}
> WAIT WINDOW "Hiring authority must have starting and ending date"
> ENDIF
>
> ENDCASE
>ENDFUNC
>
>I still need more help on this. Once this is complete, it would be just what I need, so can you help me with this one? Not only the WAIT WINDOW, but I need to have the cursor stay in that record if it's not correct. In other words, while in the BROWSE screen, repeat, in BROWSE screen, I want to do the record level checking while EDITING or ADDING the record and must not leave until the field requirements are done for any specific authorizations in the auth.authtype. I will repeat my question... how to have this be able to keep the cursor in the record if the other requirements are not met?
>
>Bonus, while in the BROWSE screen, if the user hits the ESCAPE key, can it be "reverted" to as what was there in the first place (one or more fields). Also, if it was a new record and upon hitting the ESCAPE key, can that record be deleted? Maybe it is something that VFP 6.0 does by itself anyway?
>
>With this coding above, it works, but it would still allow me to leave the record WHILE IN THE BROWSE SCREEN, which I dont want that. This Function is in the "Stored Procedures" of the database and the "verfield()" is in the "record validation" of the table. Do you understand my question?
>
>Chuck
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform