Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox - basic query
Message
From
26/07/2010 14:22:19
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01473935
Message ID:
01473950
Views:
39
Naomi

Just quickly trying:

REPLACE FRUITS.GROUP WITH THIS.DISPLAYVALUE

does indeed do what I wanted.

But, out of interest and to satifsy my curiosity, without putting such code into the Valid of the combobox, how would user inputted text into the text portion of a combobox ever be retained in the bound control. I assumed that the bound control would simply accept the value typed in. Does the default behaviour of the valid clause of a combobox automatically check to make sure the typed in value is in the list of supplied values?

Thanks for the pointer
Barry Sutton



>Try
>
>Message ID: 1164880
>
>>I fear I am missing something very obvious, but am at a loss to see it....
>>
>>Suppose I have "Fruits" table with 2 fields - "group","type". I have 6 records with the following data in the 2 fields:
>>
>>"Apple","Cox"
>>"Apple","Desire"
>>"Banana", "Panama"
>>"Cherry", "Delight"
>>"Banana", "Spanish"
>>"Cherry", "BlackJack"
>>
>>I have a form with the "Fruits" table in the dataenvironment and a combobox set to style 0 - dropdown combo - with rowsourcetype set to SQL and the rowsource set to: "select distinct fruits.type from fruit into cursor mylist"
>>The control source for the combobox is set to Fruits.group.
>>This provides a combobox with the entries "Apple","Banana","Cherry" and also allows user input of another group item.
>>
>>When adding a new record,as well as accepting existing entries, I want to be able to add a further "group" on-the-fly e.g. "Oranges" with a "type" entry of say "Seville".
>>
>>My problem is that when I type in a new group entry it is not stored to the underlying Fruits table. The underlying table will only accept values listed in the sql cursor. The field Fruits.group remains empty, although the Fruits.type field is correctly filled.
>>
>>At present I can not see how typing anything in the textbox portion of a combobox ever gets saved. I am clearly missing the point here - can someone explain what I am doing wrong? (Databuffering on the table is set to 0)
>>
>>Thanks
>>Barry Sutton
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform