Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trapping for adding a new member in a COMBO BOX.
Message
From
25/09/1997 15:39:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00051450
Message ID:
00051647
Views:
36
>>>>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.

thanks Colin... I will look at your code... thanks again.. :)
Robert Keith
Independent Developer
San Antonio, Texas
E-mail address:
rebelrob1@yahoo.com
Previous
Reply
Map
View

Click here to load this message in the networking platform