I have to comboboxes that are on a toolbar and are related. One shows the company id number and the other shows the company name. This allows the user to select a company using either method. The problem is, once you have selected a company using both combo boxes, they both remain selected (their display value is highlighted), then the incremental search ability only works by name, not be number, no matter which box you are in. All fields are character. Here are my properties for the company # combobox:
BoundColumn = 1
ColumnCount = 2
ControlSource = goPub.cCompany (public property - company #)
Rowsource = SELECT company, ' - ' + name from company INTO CURSOR csrtbCo ORDER BY company
RowSourceType = 3
And for the Name combobox:
BoundColumn = 3
ColumnCount = 3
ControlSource = goPub.cCompany (public property - company #)
Rowsource = SELECT name, ' - ' , company from company INTO CURSOR csrtbCoName ORDER BY Name
RowSourceType = 3
In the InteractiveChange event I have the following code for the Company # combo:
IF this.Value != company.company
goPub.cCompany = this.Value
SELECT company
LOCATE FOR company = goPub.cCompany
ENDIF
And this code for the Company Name combo:
IF csrtbCoName.Company != Company.Company
SELECT company
LOCATE FOR Company = csrtbCoName.Company
goPub.cCompany = Company
ENDIF
I am using VFP 8, by the way. Any ideas??
Sebastian
BoundColumn = 1
ColumnCount = 2
ControlSource = goPub.cCompany (public property - company #)
Rowsource = SELECT company, ' - ' + name from company INTO CURSOR csrtbCo ORDER BY company
RowSourceType = 3
And for the Name combobox:
BoundColumn = 3
ColumnCount = 3
ControlSource = goPub.cCompany (public property - company #)
Rowsource = SELECT name, ' - ' , company from company INTO CURSOR csrtbCoName ORDER BY Name
RowSourceType = 3
In the InteractiveChange event I have the following code for the Company # combo:
IF this.Value != company.company
goPub.cCompany = this.Value
SELECT company
LOCATE FOR company = goPub.cCompany
ENDIF
And this code for the Company Name combo:
IF csrtbCoName.Company != Company.Company
SELECT company
LOCATE FOR Company = csrtbCoName.Company
goPub.cCompany = Company
ENDIF
I am using VFP 8, by the way. Any ideas??
Sebastian