Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trapping for adding a new member in a COMBO BOX.
Message
 
À
25/09/1997 09:10:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00051450
Message ID:
00051588
Vues:
38
>>>I want to write code in the event when a new member is added
>>>in a COMBO BOX. Does anybody know what the name of that event is?
>>>thanks..
>>Hi Robert.
>>
>>If you are talking about adding a new member to a drop down combo, you have to check for ComboBox.DisplayValue <> ComboBox.Value. Then you decide if you want to add the new item. How you do it depends on what your RowSource is. Afterwards, do a ComboBox.Requery().
>>
>>Marcia
>Hi Marcia
>thanks for your answering and I will look into it... thanks again.. :)

I placed the following code in the ComboBox's .Valid method to accomplish what you're trying to do. The list contains position titles to be assigned to employees:

IF NOT SEEK(ALLTRIM(THIS.DisplayValue),"POSITION")
mnadd=MESSAGEBOX("Do you wish to add this position type?",4+32+256,;
ALLTRIM(THIS.DisplayValue)+" not found")
IF mnadd=6
INSERT INTO Position (Position) ;
VALUES (THIS.DisplayValue)
REPLACE People.Position WITH THIS.DisplayValue
THISFORM.rtgPageFrame1.Page1.cmbPosition.Requery
THISFORM.rtgPageFrame1.Page1.Refresh
ELSE
THISFORM.rtgPageFrame1.Page1.cmbPosition.DisplayValue=""
THISFORM.rtgPageFrame1.Page1.cmbPosition.Value=""
THISFORM.rtgPageFrame1.Page1.cmbPosition.SetFocus
ENDIF
ENDIF

Hope this helps.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform