Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Box Problem

Status
Not open for further replies.

Creeder

Programmer
Jul 5, 2000
110
MY
Hi all,

I have this following table,

Table : Company
Column: Name, Alias, Company_id

I then assigned the rowsource of the combo box to this table, displaying the 3 columns in the combo box.

The Problem:
Let's say if i do a search on the Alias and company_id,eg

Locate FOR Alias = 'ALD' AND Company_id = 5

and when FOUND() = .T., how do i dynamically change the display value in the combo box?

I've tried Requery() but it's not working. Any help is greatly appreciated.

Thanks

Yue Jeen [sig][/sig]
 
If the RowSource is the table, you could try Refresh(), but I don't think that will work. You'll probably need to add code to the end of your LOCATE section that sets the ComboBox.Value to the value matching the found record (depending on which ComboBox column is the BoundColumn). [sig]<p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br> [/sig]
 
Yeap it works. Coding something like

LOCATE FOR ....

IF FOUND()
THISFORM.combo1.Value = <value>
ENDIF

solves the problem. Thanks again for the instance response foxdev.

Yue Jeen
[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top