Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Change a Combobox programatically
Message
From
09/11/1999 04:10:59
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to Change a Combobox programatically
Miscellaneous
Thread ID:
00288914
Message ID:
00288914
Views:
47
I have two dropdown comboboxes populated by cursors. The contents of the second combobox is a list of names dependent on the first. Sometimes a name will be in the second list when the first is changed, at other times it won't. When the name appears in the changed list, I want it to remain. When it doesn't appear, I want the value to be the first name in the list.

I can get the second list to always show the top name, or to always show the previous name (even when it is not in the requeried list) but I can't get it to behave as described above.

My current code is below, I've tried many combinations and I've left some of the lines (eg displayvalue etc) out, but I can't get the combobox value to show correctly. Can anyone tell me what's wrong with the code below?


Do MyProgram && SELECT THE CORRECT RECORDS FOR MYCURSOR
this.parent.combo.requery
sele mycursor
if reccount("mycursor")>0
locate for mynumfield=storedNumber
if .not. found()
go top
endif
m.control_source_variable=mycursor.myfield
this.partne.combo.value=mycursor.myfield
this.parent.combo.displayvalue=mycursor.myfield
endif
this.parent.combo.refresh

TIA
David O'Brien
Reply
Map
View

Click here to load this message in the networking platform