Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error Trap Combo Box for Invalid Entry
Message
De
23/07/1998 15:11:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00120668
Message ID:
00120681
Vues:
24
>To make it easier on the user in making a selection from a combo box, I am displaying a list of employee.nmbr, fname, lame in a dropdown combo box. The employee table is a parent and is ORDERed by nmbr. A child table's fields are displayed in a grid below for the selected employee.
>
>Everything goes fine as long as the user either selects an employee from the dropdown combo or types in a valid employee.nmbr in the combo's edit area. However, if the user types in an invalid employee.nmbr in the combo edit area, the display still shows an employee.fname & lname in a label that I have placed just above the grid, to wit:
>
>
>ThisForm.Label5.Caption= ;
>	ALLTRIM(prlink.fname)+" "+ ;
>	ALLTRIM(prlink.lname)
>
>
>EXAMPLE:
>If '9999' is entered into the combo's edit area, the employee's name from the last indexed record, '9801', is displayed.
>
>Thanks in advance for the help, CH.

Firstly, you can prevent typing in text protion by using drop-down list. If it's not a case, then you can reset Label.Caption from Combo.Interactivechange event.
*** Combo.Interactivechange
if this.displayvalue != This.value
thisform.label.caption=""
else
thisform.label.caption=ALLTRIM(prlink.fname)+" "+ ;
ALLTRIM(prlink.lname)
endif

BTW, you can always provide that fname+lname will appear in text portion of combo itself.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform