Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox - Additems
Message
From
23/02/1998 09:46:30
 
 
To
21/02/1998 11:34:05
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00080245
Message ID:
00080430
Views:
27
>>Dan,
>>
>>You can't use AddItem for a combobox that has a rowsource. If the rowsource is a table, you would have to add a record to the table, which I'm sure you don't want to do. Instead, you could have no rowsource, SCAN the table and add each record (and the '' item) to the box using AddItem().
>>
>>>This may be a simple problem for some, but not for me. I have a combobox that has a rowsource from a table. I would like to add a item, called '', which when selected from the combobox would pull up an input box for the item to add, append a record to the table, and refresh the database.
>>>
>>>I am having the hardest time trying to figure out how to add the '' item, and where to put the code to check on the selection of the combobox, to run through my append code.
>>>
>>>Any suggestions,
>>>Dan
>
>I have run into the same problem with a listbox. It works to populate the list box using additem() instead of binding to a table. However, when it's time to save changes made to the listbox/combobox how is this done? My solution was to delete each record in the table that orginally populated the list and then save each item in the list back to the table. It works when you only have a few items in your list but would be very wasteful for large applications.

The generic approach to list or combobox is to look at Rowsource first, i.e. if you want to change something (e.g. add item) in listbox or in list portion of combobox, the you go to the Rowsource (table), add record over there and issue List(Combo).Requiry and everybody is happy :).
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform