Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do you add to a COMBO BOX?
Message
From
30/10/1997 12:37:06
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00057406
Message ID:
00057437
Views:
39
>>>Robert,
>>>
>>>Are you trying to allow the user to enter a value in the textbox area of the combobox and if what they typed doesn't already exist in the combobox add it to the combobox choices?
>>
>>Colin,
>>yes - I want to treat the combo like a field.
>
>Robert,
>
>I've done something similar. The combobox is a list of positions and allows the user to add new values. The code below is in the combobox's .Valid method. The combobox's RowSource is Position.Position and the ControlSource is People.Position.
>
>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

thanks Colin, I will check it out...
.... :))))))
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