Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding records with a Combobox
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00255190
Message ID:
00255217
Views:
12
Hi Pete,

Here is an example of what I have done to do this:
In the combobox .Valid Event for picking a Job Position or entering a new one

IF THIS.ListIndex=0 AND ALLTRIM(THIS.DisplayValue)#""  && The value isn't in the list and isn't blank
	?? CHR(7)
	mnadd=MESSAGEBOX("Do you wish to add this position type?",4+32+256,;
		ALLTRIM(THIS.DisplayValue)+" not found")   && Ask the user to add in case of typo's
	IF mnadd=6
		INSERT INTO Position (Position) ;
			VALUES (THIS.DisplayValue)   && Insert into source
		THIS.Requery
		THISFORM.rtgPageFrame1.Page1.Refresh
	ELSE
		THIS.DisplayValue=""
		THIS.Value=""
	ENDIF
ENDIF
HTH

>Hello All,
>I have a requirement to produce a drop down combo, that displays a field from a table, and allows the user to add a record by typing directly into the combo and hitting enter, any ideas would be appreciated as I don't have much time
>
>TIA
>
>Pete Kane
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.
Previous
Reply
Map
View

Click here to load this message in the networking platform