Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combobox Problems
Message
From
02/09/1997 16:25:42
 
 
To
02/09/1997 15:38:23
Frank Shaw
Runestones Development Corporation
Ipswich, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00048090
Message ID:
00048104
Views:
23
> I have a combobox and if the data comes from a table where the record has a character defined field and the actual value is like 01. When doing a skip or going to next record the contents in the field does not show in the left side of the combobox do you have a idea as to what is or could be happening here. What properties would you use to bring in the value contained in the record for that field and what properties would you use to change back before writing value out to the record. The right side of the combobox has a pull down where the value do pull down fine. It is just the left side that seems to have the problem. Also I want to retrieve the second column in the pull down from a combobox what are the properties for the second column unstead of the first need to be set.

There are two combo properties which you should use: Value and DisplayValue. If you have
with Thisform.Combo1
.ColumnCount=2
.RowSourceType=6 && fields
.RowSource="table1.name,id"
.BoundColumn=2
endwith
Then Combo1.DisplayValue (actually shown in Text portion of the combo) will show Table1.Name and Combo1.Value (could be used for data editing session) will store Table1.Id.
If you want to add new records to Table1 on fly, use following code (e.g. in Combo.Lostfocus event):
Select Table1
Set Order to Name
Seek this.DisplayValue
If Not Found()
Insert into Table1 (id,name) values(getnewid(),This.displayvalue)
Endif
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform