Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to ckick button when focus is in field with invalid
Message
De
04/10/2002 18:47:20
 
 
À
04/10/2002 15:22:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00707894
Message ID:
00707988
Vues:
18
Hi Alan.

I have a situation where the user is entering employee numbers in a text box. If the data is valid, cursor advances to next object. If data is invalid, focus stays in the original text box. I have a button on the screen to allow the user to add new employees to the table. If they have entered and invalid employee number in the field, and then click the add button, the data is still in error and the valid event is processed on the text box. They have to clear the data before clicking the add button.

I would handle this situation a little differently than you are. I would call a method from the Valid() of the text box that would pop up a message box saying something like "This employee number is not currently in the datanase. Do you want to add this employee now?" Then, if the user answers yes, you can pop up the form that allows the user to add the new employee.

You can still have the button that allows the user to add the new employee. You just call the same method from both the employee number text box and the click event of the command button.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform