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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid to populate combo box

Status
Not open for further replies.

rene316

Programmer
Jan 14, 2002
81
US
I need to make a combox load the value of a row from a grid, only when the grid's row is clicked. I was tring to put in the click event of the text1 part of column1 somthing like this

Thisform.cboField.Value = grdGrid1.Column1.text1

but it errors out.

I also want to sort the columns in the grid, if they are clicked, by the column they click.

thanks in advance
 
rene316

Normally a combobox is meant to be used as a control that holds more then one value, but...
Try this:

Thisform.cboField.DisplayValue = grdGrid1.Column1.text1.value
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
To add to what I said. You may not get the expected value to show up in the combo. You may want to pick-up the value from the underlying table.

Thisform.cboField.DisplayValue = myCursor.field1
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I get the error grdGrid1 is not an object.


I use combo because I want to be able to either use the drop down of the combo, or the grid to locate the data. I dont know that much about VFP, maybe I'm doing this all wrong, please advise.


thanks again
-Mike
 
Try:
Thisform.cboField.DisplayValue = this.value
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top