Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I use combo box to accept entry from user?
Message
From
22/08/2004 11:35:02
 
 
To
18/08/2004 21:05:46
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00934336
Message ID:
00935315
Views:
24
Hi Evelyn.

i have a combo where recordsource is (select * from comments). user has to select from the records in table comments.

The sumplest approach is going to be to change the RowSourceType of your combo to either 2-Alias or 6-Fields. Then, you add a little bit of code like this in the Valid() of the combo:
lcDisplayValue = ALLTRIM( This.DisplayValue )
IF NOT EMPTY( lcDisplayValue ) AND This.ListIndex = 0
  *** The user has typed something that is not in the combo's list
  *** add it to the underlying data now
  INSERT INTO Comments ( < Field Name > ) VALUES ( lcDisplayValue )
  TABLEUPDATE( 0, .F., [Comments] )
  This.Requery()
ENDIF
Previous
Reply
Map
View

Click here to load this message in the networking platform